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(...)
.
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.
精彩评论