Results 1 to 5 of 5

Thread: Memory leak org/hibernate/engine/StatefulPersistenceContext

Threaded View

  1. #1
    Join Date
    Feb 2011
    Posts
    2

    Default Memory leak org/hibernate/engine/StatefulPersistenceContext

    We have a lot of OutOfMemory error in our application
    After analyzing the JVM, we supsect some MemoryLeak due to org/hibernate/engine/StatefulPersistenceContext.
    We are using:
    -Websphere 6.1 + Spring Hibernate 3.0.1.RELEASE-A + Hibernate 3.2.7.ga

    SessionFactory:class="org.springframework.orm.hibe rnate3.LocalSessionFactoryBean"
    transactionManager:class="org.springframework.tran saction.jta.JtaTransactionManager"
    in our DAO:
    public class xxxDaoImpl extends BaseDao {
    public void createXXX(Object obj) throws DataAccessException {
    this.getHibernateTemplate().saveOrUpdate(obj);
    etc....

    I turned the debug on and we got something like:
    2011-02-10 13:40:34,024 | DEBUG | org.springframework.orm.hibernate3.SessionFactoryU tils - Opening Hibernate Session
    2011-02-10 13:40:34,024 | DEBUG | org.springframework.orm.hibernate3.SessionFactoryU tils - Registering Spring transaction synchronization for new Hibernate Session
    2011-02-10 13:40:34,024 | DEBUG | org.springframework.orm.hibernate3.HibernateTempla te - Found thread-bound Session for HibernateTemplate
    2011-02-10 13:40:34,029 | DEBUG | org.springframework.orm.hibernate3.HibernateTempla te - Not closing pre-bound Hibernate Session after HibernateTemplate
    etc.....
    2011-02-10 13:40:34,045 | DEBUG | org.springframework.orm.hibernate3.SessionFactoryU tils - Closing Hibernate Session
    2011-02-10 13:40:34,045 | DEBUG | org.springframework.orm.hibernate3.SessionFactoryU tils - Opening Hibernate Session


    Can you help me please on how to optimize spring/hibernate sessions?
    How can i flush/close session if Spring JTA manager is not doing the job?

    Do you have any ideas?

    Thanks
    Last edited by David M; Feb 10th, 2011 at 08:52 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •