Hibernate session.flush() in multi statement transaction
Hi I am facing strange behavior in hibernate.
I am doinght.saveOrUpdate(myObj)
on an object.
In the same method i am next loading a view from database which also contains the above
(table) myObj.
ht.findByNamedParam( from myView ...) ;
But strangely in the loaded view do not have the recently updated values! I have also tried to ca开发者_StackOverflow社区ll ht.flush() before the load but still its fetching old values of tabel myObj and not the updated once. session.flush() is not working.
Code is something like : ( Note: all 3 are in same method and called in same transaction)
ht.saveOrUpdate(myObj);
ht.flush();
ht.findByNamedParam( from myView....);
Please suggest.
Thanks
精彩评论