开发者

Could not force hibernate to go to the database to get new object

Session Factory:

hibernate.current_session_context_class=jta
hibernate.cache.use_second_level_cache=false

Transaction: - UserTransaction is used.

getCurrentSession() of SessionFactory is used to get Session.

The problem is that I could not force the hibernate to access database to get the new values using Session.get(...)开发者_如何转开发 (it is updated outside) although I used Session.clear() or Session.evict(…) or Session.refresh(…), SessionFactory.evict(...).

It always kept the old values.

Do you have any idea?


session.flush() --- will flush your memory update in db. session.clear() will clear session.

Now query again will fire on database.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜