-->
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.  [ 5 posts ] 
Author Message
 Post subject: Help! GenericJDBCException: Cannot release connection
PostPosted: Thu Aug 03, 2006 3:36 pm 
Newbie

Joined: Thu Oct 06, 2005 8:08 pm
Posts: 19
Hibernate 3.2CR3

I'm getting this exception. Does anyone have any ideas why or what I can do to debug?

Code:
Caused by: org.hibernate.exception.GenericJDBCException: Cannot release connection
        at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
        at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
        at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
        at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:449)
        at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:400)
        at org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:287)
        at org.hibernate.jdbc.JDBCContext.afterNontransactionalQuery(JDBCContext.java:241)
        at org.hibernate.impl.SessionImpl.afterOperation(SessionImpl.java:417)
        at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1577)
        at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
        at com.auenrec.wiki.webbean.ReviewsController.getTopRecentReviews(ReviewsController.java:310)
        at sun.reflect.GeneratedMethodAccessor660.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.sun.faces.el.PropertyResolverImpl.getValue(PropertyResolverImpl.java:79)
        at com.sun.facelets.el.LegacyELContext$LegacyELResolver.getValue(LegacyELContext.java:141)
        at com.sun.el.parser.AstValue.getValue(AstValue.java:96)
        at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:183)
        at com.sun.facelets.el.TagValueExpression.getValue(TagValueExpression.java:71)
        at com.sun.facelets.el.LegacyValueBinding.getValue(LegacyValueBinding.java:56)
        ... 38 more
Caused by: java.sql.SQLException: Already closed.
        at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:77)
        at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:180)
        at org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:74)
        at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:445)
        ... 54 more


Top
 Profile  
 
 Post subject: Re: Help! GenericJDBCException: Cannot release connection
PostPosted: Sat Oct 27, 2007 11:47 pm 
Newbie

Joined: Fri Sep 22, 2006 1:04 am
Posts: 5
Hibernate 3.2.5.ga

when server not work more 12 hours:



Code:

2007-10-28 09:06:02,891 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 11935407628
2007-10-28 09:06:02,891 DEBUG [org.hibernate.engine.query.QueryPlanCache] located HQL query plan in cache (from Users where login=:login)
2007-10-28 09:06:02,891 DEBUG [org.hibernate.engine.query.QueryPlanCache] located HQL query plan in cache (from Users where login=:login)
2007-10-28 09:06:02,891 DEBUG [org.hibernate.engine.query.HQLQueryPlan] find: from Users where login=:login
2007-10-28 09:06:02,891 DEBUG [org.hibernate.engine.QueryParameters] named parameters: {login=nik}
2007-10-28 09:06:02,891 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to open PreparedStatement (open PreparedStatements: 0, globally: 0)
2007-10-28 09:06:02,891 DEBUG [org.hibernate.jdbc.ConnectionManager] opening JDBC connection
2007-10-28 09:06:02,891 DEBUG [org.hibernate.SQL]
    select
        users0_.id as id10_,
        users0_.first_name as first2_10_,
        users0_.last_name as last3_10_,
        users0_.is_locked as is4_10_,
        users0_.login as login10_,
        users0_.password as password10_,
        users0_.position_id as position7_10_
    from
        users users0_
    where
        users0_.login=?
2007-10-28 09:06:02,891 DEBUG [org.hibernate.jdbc.AbstractBatcher] preparing statement
2007-10-28 09:06:02,891 DEBUG [org.hibernate.type.StringType] binding 'nik' to parameter: 1
2007-10-28 09:06:02,954 DEBUG [org.hibernate.jdbc.AbstractBatcher] about to close PreparedStatement (open PreparedStatements: 1, globally: 1)
2007-10-28 09:06:02,954 DEBUG [org.hibernate.jdbc.AbstractBatcher] closing statement
2007-10-28 09:06:02,954 DEBUG [org.hibernate.jdbc.ConnectionManager] aggressively releasing JDBC connection
2007-10-28 09:06:02,954 DEBUG [org.hibernate.jdbc.ConnectionManager] releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)]
2007-10-28 09:06:02,985 DEBUG [org.hibernate.util.JDBCExceptionReporter] Cannot release connection [???]
java.sql.SQLException: Already closed.
   at org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:84)
   at org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:181)
   at org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:74)
   at org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:451)
   at org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:406)
   at org.hibernate.jdbc.ConnectionManager.afterStatement(ConnectionManager.java:281)
   at org.hibernate.jdbc.AbstractBatcher.closePreparedStatement(AbstractBatcher.java:543)
   at org.hibernate.jdbc.AbstractBatcher.closeStatement(AbstractBatcher.java:269)
   at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:285)
   at org.hibernate.jdbc.AbstractBatcher.closeQueryStatement(AbstractBatcher.java:212)
   at org.hibernate.loader.Loader.getResultSet(Loader.java:1801)
   at org.hibernate.loader.Loader.doQuery(Loader.java:674)
   at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
   at org.hibernate.loader.Loader.doList(Loader.java:2220)
   at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
   at org.hibernate.loader.Loader.list(Loader.java:2099)
   at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:378)
   at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
   at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
   at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
   at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
   at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:66)
   at DBManager.query(DBManager.java:129)
   at AuthorizationFilter.getUser(AuthorizationFilter.java:205)
   at AuthorizationFilter.doFilter(AuthorizationFilter.java:109)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
   at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:433)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
   at java.lang.Thread.run(Thread.java:595)


second query worked normally


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 1:22 am 
Newbie

Joined: Fri Sep 22, 2006 1:04 am
Posts: 5
problem solved:

in context.xml

<Context antiResourceLocking="false" privileged="true" crossContext="true">

<Resource
name="jdbc/bdDS"
auth="Container"
type="javax.sql.DataSource"
username="museum"
password="museum"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/bd"
maxActive="8"
maxIdle="4"
validationQuery="SELECT 1"
testOnBorrow="true"

/>

<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>

</Context>


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 06, 2007 1:22 am 
Newbie

Joined: Fri Sep 22, 2006 1:04 am
Posts: 5
problem solved:

in context.xml

<Context antiResourceLocking="false" privileged="true" crossContext="true">

<Resource
name="jdbc/bdDS"
auth="Container"
type="javax.sql.DataSource"
username="***"
password="***"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://host:port/bd"
maxActive="8"
maxIdle="4"
validationQuery="SELECT 1"
testOnBorrow="true"

/>

<Resource name="UserTransaction" auth="Container"
type="javax.transaction.UserTransaction"/>
<ResourceParams name="UserTransaction">
<parameter>
<name>factory</name>
<value>org.objectweb.jotm.UserTransactionFactory</value>
</parameter>
<parameter>
<name>jotm.timeout</name>
<value>60</value>
</parameter>
</ResourceParams>

</Context>


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 23, 2008 5:12 am 
Newbie

Joined: Tue Jul 01, 2008 7:30 am
Posts: 11
Location: Pune,India
Hi here is my context.xml

<Context path="/ms" reloadable="true" antiResourceLocking="false" privileged="true" crossContext="true"
>

<Resource
name="jdbc/dataSource"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="****" password="***"
driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver"
url="jdbc:sqlserver://srvr:1433;databaseName=medstaff_portaldev"
validationQuery = "SELECT 1"
testOnBorrow="true"
/>
</Context>

but it didnt worked , still giving same exception (can not release connection)

Please let me know what to do.
Thanks in advance for help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.