HibernateTemplate alwaysUseNewSession

Posted by DD on Stack Overflow See other posts from Stack Overflow or by DD
Published on 2010-04-23T18:09:50Z Indexed on 2010/04/23 18:13 UTC
Read the original article Hit count: 186

Filed under:
|
|

Hi, I had a problem where I was using the hibernate template to do most of my DB work but I had a part of the system that directly accessed the session to do batch persisting. I noticed that the hibernate template session was old and would be storing cached values which didnt take into account the objects save with the session directly.

What are the drawbacks of using alwaysUseNewSession? This fixes the problem as I always get up-to-date objects.

Thanks.

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about spring