tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Mikusa <dmik...@gopivotal.com>
Subject Re: Error in DBCP Connection Pool with tomcat 6.x
Date Wed, 02 Jul 2014 11:34:42 GMT
On Wed, Jul 2, 2014 at 1:48 AM, Vijendra Pachoriya <
Vijendra.Pachoriya@indegene.com> wrote:

> Hi Filip,
>
> This error comes at some point of time on production, when the server is
> on load.
>
> I am using hibernate and not closing any connection manually, its all
> managed by hibernate and tomcat dbcp connection pool.
>
> For me it seems like DBCP is trying to close the connection which is
> already closed by the database server.
>

Have you tried looking at your database server logs to see if it's closing
the connection?  You mentioned it's under load.  Perhaps you've hit some
limit (real or arbitrary) and it's dropping you.

Dan


> Please refer below related links.
>
> https://issues.apache.org/jira/browse/DBCP-329
>
>
> http://markmail.org/message/c2gx2xuzum4pv743#query:+page:1+mid:ncvixx4ewe7pho2x+state:results
>
>
> Regards,
> Vijendra
>
> -----Original Message-----
> From: Filip Hanik [mailto:filip@hanik.com]
> Sent: 01 July 2014 21:06
> To: Tomcat Users List
> Subject: Re: Error in DBCP Connection Pool with tomcat 6.x
>
> Looks like your code already called java.sql.Connection.close() and then
> attempts to use the connection again
>
> Filip
>
>
>
> On Tue, Jul 1, 2014 at 8:09 AM, Propes, Barry L <barry.l.propes@citi.com>
> wrote:
>
> >
> >
> > -----Original Message-----
> > From: Vijendra Pachoriya [mailto:Vijendra.Pachoriya@indegene.com]
> > Sent: Tuesday, July 01, 2014 2:31 AM
> > To: users@tomcat.apache.org
> > Cc: Alok Roy
> > Subject: Error in DBCP Connection Pool with tomcat 6.x
> >
> > Hi Tomcat Team,
> >
> > Please help me out in solving below error.
> >
> > Below is the details :
> >
> > ================Configuration in my
> > context.xml============================
> >
> >
> > <Resource name="jdbc/ABC"
> >         auth="Container"
> >         type="javax.sql.DataSource"
> >         maxActive="50"
> >         maxIdle="10"
> >         maxWait="10000"
> >         username="ABC"
> >         password="ABC"
> >         removeAbandoned="true"
> >         logAbandoned="true"
> >         testOnBorrow="true"
> >         testWhileIdle="true"
> >         timeBetweenEvictionRunsMillis="30000"
> >         validationQuery="SELECT 1 FROM dual"
> >         driverClassName="oracle.jdbc.driver.OracleDriver"
> >         url="jdbc:oracle:thin:@MY_DB" />
> >
> >
> > ==========================Error Message
> > ============================================
> >
> > at
> >
> org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
> >         at
> >
> org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
> >         at
> >
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
> >         at java.lang.Thread.run(Thread.java:679)
> > Caused by: org.springframework.transaction.TransactionSystemException:
> > Could not roll back JPA transaction; nested exception is
> > javax.persistence.PersistenceException: unexpected error when rollbacking
> >         at
> >
> org.springframework.orm.jpa.JpaTransactionManager.doRollback(JpaTransactionManager.java:486)
> >         at
> >
> org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:800)
> >         at
> >
> org.springframework.transaction.support.AbstractPlatformTransactionManager.rollback(AbstractPlatformTransactionManager.java:777)
> >         at
> >
> org.springframework.transaction.interceptor.TransactionAspectSupport.completeTransactionAfterThrowing(TransactionAspectSupport.java:339)
> >         at
> >
> org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
> >         at
> >
> org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >         at
> >
> org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >         at sun.proxy.$Proxy185.selectPharmaUser(Unknown Source)
> >         at
> >
> com.aptilon.axcelrx.server.service.impl.AuthenticationServiceImpl.login(AuthenticationServiceImpl.java:170)
> >         at
> >
> com.aptilon.axcelrx.server.ws.endpoint.AuthenticationEndpoint.login_aroundBody0(AuthenticationEndpoint.java:110)
> >         ... 45 more
> > Caused by: javax.persistence.PersistenceException: unexpected error
> > when rollbacking
> >         at
> > org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:88)
> >         at
> >
> org.springframework.orm.jpa.JpaTransactionManager.doRollback(JpaTransactionManager.java:482)
> >         ... 54 more
> > Caused by: org.hibernate.exception.GenericJDBCException: Cannot
> > release connection
> >         at
> >
> org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
> >         at
> >
> org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
> >         at
> >
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
> >         at
> >
> org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)
> >         at
> >
> org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:478)
> >         at
> >
> org.hibernate.jdbc.ConnectionManager.aggressiveRelease(ConnectionManager.java:429)
> >         at
> >
> org.hibernate.jdbc.ConnectionManager.afterTransaction(ConnectionManager.java:316)
> >         at
> >
> org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:248)
> >         at
> >
> org.hibernate.transaction.JDBCTransaction.rollback(JDBCTransaction.java:208)
> >         at
> > org.hibernate.ejb.TransactionImpl.rollback(TransactionImpl.java:85)
> >         ... 55 more
> > Caused by: java.sql.SQLException: Already closed.
> >         at
> >
> org.apache.tomcat.dbcp.dbcp.PoolableConnection.close(PoolableConnection.java:114)
> >         at
> >
> org.apache.tomcat.dbcp.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.close(PoolingDataSource.java:191)
> >         at
> >
> org.hibernate.connection.DatasourceConnectionProvider.closeConnection(DatasourceConnectionProvider.java:97)
> >         at
> >
> org.hibernate.jdbc.ConnectionManager.closeConnection(ConnectionManager.java:474)
> >         ... 60 more
> >
> >
> > ======================================================================
> > =====
> >
> > Your help in this regard is highly appreciated.
> >
> >
> > Thanks & Regards,
> > Vijendra
> >
> >
> > -----------
> > I've also got these attributes in my xml file, FWIW.
> >
> > name="jdbc/myoracle"
> > timeBetweenEvictionRunsMillis="-1"   (you show 30000) - I think I had to
> > move it to this to avoid some faulty issue, per Konstantin
> > minEvictableIdleTimeMillis="28800"
> > removeAbandonedTimeout="300"
> >     logAbandoned="false"
> >
> >
> > I say this, because I, too, was using a Tomcat 6.x version - 6.0.29 to
> > be exact.
> >
> > On the surface it looks like some error is occurring during the
> > commit, and then trying to roll back, but then your connection is
> > maybe closing before it can roll back?
> >
> > HTH,
> >
> > Barry
> >
> >
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message