Jul 12th, 2007, 02:32 AM
How clear session on commit?
I searched on many forums, but I don't find it.
I manage a lots of data with Spring, every 200 data I commit (with transaction). But an Out Of Memory happens, I think it's causes by first level cache which are not cleared. How can I force clear session on commit ?
Jul 12th, 2007, 02:51 AM
Which OR-mapper do you use? If it is Hibernate, then have a look ak Session.evict and Session.clear.
Jul 12th, 2007, 07:27 AM
I don't explicitly use evict or clear on the session. When transaction ended, I want a clear is call in the session and clear the first level cache.
Jul 12th, 2007, 08:38 AM
The session is the first-level cache. And if you want to clear the session then you have to call the clear-method. At least I am not aware of a possibility to clear sessions implicitly.
Originally Posted by wizmerhill
Jul 12th, 2007, 08:40 AM
Jul 12th, 2007, 10:09 AM
I want when commit occurs then session is clear. Is it the default behavior or a property exists ?
Jul 12th, 2007, 10:41 AM
Between two transactions first level cache is clear ?
Question : between two transactions, is first level cache clear ?
Jul 12th, 2007, 11:18 AM
No... Not if you clear it yourself... You need to call session.clear() and/or session.evict to make that happen.