-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: hibernate.transaction.auto_close_session
PostPosted: Mon Jan 23, 2006 12:19 pm 
Newbie

Joined: Wed Jan 04, 2006 2:57 pm
Posts: 3
i'm not sure why it is happening. in my hibernate.cfg.xml, i had set
"hibernate.transaction.auto_close_session" to false. but when i looked at
the debug log, i noticed the following:

11:12:04,322 [DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener] executing flush
11:12:04,322 [DEBUG http-8080-Processor24 org.hibernate.event.def.AbstractFlushingEventListener] post flush
11:12:04,323 [DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext] before transaction completion
11:12:04,323 [DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl] before transaction completion
11:12:04,324 [DEBUG http-8080-Processor24 org.hibernate.transaction.JDBCTransaction] committed JDBC Connection
11:12:04,324 [DEBUG http-8080-Processor24 org.hibernate.jdbc.JDBCContext] after transaction completion
11:12:04,324 [DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
11:12:04,325 [DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
11:12:04,325 [DEBUG http-8080-Processor24 com.mchange.v2.c3p0.stmt.GooGooStatementCache] checkinAll(): com.mchange.v2.c3p0.stmt.GlobalMaxOnlyStatementCache stats -- total size: 10; checked out: 0; num connections: 3; num keys: 10
11:12:04,326 [DEBUG http-8080-Processor24 com.mchange.v2.resourcepool.BasicResourcePool] trace com.mchange.v2.resourcepool.BasicResourcePool@6c5482 [managed: 3, unused: 2, excluded: 0] (e.g. com.mchange.v2.c3p0.impl.NewPooledConnection@89dd)
11:12:04,326 [DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl] after transaction completion
11:12:04,327 [DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl] automatically closing session
11:12:04,327 [DEBUG http-8080-Processor24 org.hibernate.impl.SessionImpl] closing session
11:12:04,327 [DEBUG http-8080-Processor24 org.hibernate.jdbc.ConnectionManager] connection already null in cleanup : no action
...
11:12:05,977 [WARN http-8080-Processor24 com.ecredit.ecdata.webapp.HibernateSessionFilter] exception caught while unbinding session
org.hibernate.SessionException: Session is closed!
at org.hibernate.impl.AbstractSessionImpl.errorIfClosed(AbstractSessionImpl.java:50)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1297)
at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:274)
at $Proxy0.isOpen(Unknown Source)
at com.ecredit.ecdata.webapp.HibernateSessionFilter.doFilter(HibernateSessionFilter.java:78)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
...


any idea?
thanks,


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 1:48 pm 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
I think that this behaviour is controlled by this property :

Code:
hibernate.connection.release_mode


Set it to "on_close" (default value) to disable aggressive releasing.


Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jan 23, 2006 5:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 3:00 pm
Posts: 1816
Location: Austin, TX
Are you using getCurrentSession()? By default those Sessions are configured to auto-close no matter what you specify for the hibernate.transaction.auto_close_session config property


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.