开发者

Hibernate session.flush() in multi statement transaction

Hi I am facing strange behavior in hibernate.

I am doing ht.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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜