Announcement Announcement Module
Collapse
No announcement yet.
How clear session on commit? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How clear session on commit?

    Hi,

    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 ?

    Thanks.

  • #2
    Which OR-mapper do you use? If it is Hibernate, then have a look ak Session.evict and Session.clear.

    Regards,
    Andreas

    Comment


    • #3
      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.

      Comment


      • #4
        Originally posted by wizmerhill View Post
        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.
        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.

        Comment


        • #5
          Originally posted by Ranie
          what is evict ?????
          http://www.hibernate.org/hib_docs/v3...-basics-issues

          Comment


          • #6
            I want when commit occurs then session is clear. Is it the default behavior or a property exists ?

            Comment


            • #7
              Between two transactions first level cache is clear ?

              Question : between two transactions, is first level cache clear ?

              Comment


              • #8
                No... Not if you clear it yourself... You need to call session.clear() and/or session.evict to make that happen.

                Comment

                Working...
                X