I'm currently using c3p0 for connection pooling under Tomcat.
Everytime I run a report, I get a "connection already closed" exception. It does not seem to do any harm as the report is already well produced.
Here is the exception:
java.sql.SQLException: JZ0S2: Statement object has already been closed.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:506)
at com.sybase.jdbc2.jdbc.SybStatement.checkDead(SybStatement.java:1879)
at com.sybase.jdbc2.jdbc.SybStatement.close(SybStatement.java:423)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$1$WrapperStatementHelper.doClose(C3P0PooledConnection.java:491)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.close(C3P0PooledConnection.java:535)
at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.closeAndRemoveResourcesInSet(C3P0PooledConnection.java:359)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.cleanupUncachedActiveStatements(C3P0PooledConnection.java:411)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.access$100(C3P0PooledConnection.java:37)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$ProxyConnectionInvocationHandler.doSilentClose(C3P0PooledConnection.java:728)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$ProxyConnectionInvocationHandler.invoke(C3P0PooledConnection.java:646)
at com.mchange.v2.c3p0.impl.$Proxy0.close(Unknown Source)
at org.efs.openreports.providers.ReportWriteProvider.fillReport(ReportWriteProvider.java:106)
at org.efs.openreports.actions.ReportRunAction.doExecute(ReportRunAction.java:124)
at webwork.action.ActionSupport.execute(ActionSupport.java:114)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:144)
at webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:161)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
Regards,
Adrian.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm not sure what you mean by using c3po for connection pooling under Tomcat. Do you
mean you are somehow using c3po instead of the standard commons-dbcp connection pooling included with Tomcat?
Are you using JNDI datasources with OpenReports or OpenReports internal connection pooling which is also commons-dbcp?
Erik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, sorry for the delayed response, seems like I didn't see your answer it at the time.
Your first question: Yes, I am using c3p0 as a replacement for commons-dbcp. That is possible since recently, as c3p0's maintainer added support for datasources.
Second question: I am using OpenReports c3p0-pooled JNDI datasources.
Here is my datasources table, for better illustration:
INSERT INTO REPORT_DATASOURCE VALUES (4,'c3p0-kercash-dev','','java:/comp/env/jdbc/c3p0-kercash-dev','','',0,0,-1,NULL,1);
INSERT INTO REPORT_DATASOURCE VALUES (3,'c3p0-kercash-production','','java:/comp/env/jdbc/c3p0-kercash-production','','',0,0,-1,NULL,1);
INSERT INTO REPORT_DATASOURCE VALUES (6,'c3p0-kercash-warehouse','','java:/comp/env/jdbc/c3p0-kercash-warehouse','','',0,0,0,NULL,1);
Those JNDI-names are for datasources configured at Tomcat context-level. They use c3p0 for connection pooling.
Regards,
Adrian.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm currently using c3p0 for connection pooling under Tomcat.
Everytime I run a report, I get a "connection already closed" exception. It does not seem to do any harm as the report is already well produced.
Here is the exception:
java.sql.SQLException: JZ0S2: Statement object has already been closed.
at com.sybase.jdbc2.jdbc.ErrorMessage.raiseError(ErrorMessage.java:506)
at com.sybase.jdbc2.jdbc.SybStatement.checkDead(SybStatement.java:1879)
at com.sybase.jdbc2.jdbc.SybStatement.close(SybStatement.java:423)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$1$WrapperStatementHelper.doClose(C3P0PooledConnection.java:491)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$2.close(C3P0PooledConnection.java:535)
at sun.reflect.GeneratedMethodAccessor53.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.closeAndRemoveResourcesInSet(C3P0PooledConnection.java:359)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.cleanupUncachedActiveStatements(C3P0PooledConnection.java:411)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection.access$100(C3P0PooledConnection.java:37)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$ProxyConnectionInvocationHandler.doSilentClose(C3P0PooledConnection.java:728)
at com.mchange.v2.c3p0.impl.C3P0PooledConnection$ProxyConnectionInvocationHandler.invoke(C3P0PooledConnection.java:646)
at com.mchange.v2.c3p0.impl.$Proxy0.close(Unknown Source)
at org.efs.openreports.providers.ReportWriteProvider.fillReport(ReportWriteProvider.java:106)
at org.efs.openreports.actions.ReportRunAction.doExecute(ReportRunAction.java:124)
at webwork.action.ActionSupport.execute(ActionSupport.java:114)
at webwork.dispatcher.GenericDispatcher.executeAction(GenericDispatcher.java:144)
at webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:161)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
Regards,
Adrian.
I'm not sure what you mean by using c3po for connection pooling under Tomcat. Do you
mean you are somehow using c3po instead of the standard commons-dbcp connection pooling included with Tomcat?
Are you using JNDI datasources with OpenReports or OpenReports internal connection pooling which is also commons-dbcp?
Erik
Hi, sorry for the delayed response, seems like I didn't see your answer it at the time.
Your first question: Yes, I am using c3p0 as a replacement for commons-dbcp. That is possible since recently, as c3p0's maintainer added support for datasources.
Second question: I am using OpenReports c3p0-pooled JNDI datasources.
Here is my datasources table, for better illustration:
INSERT INTO REPORT_DATASOURCE VALUES (4,'c3p0-kercash-dev','','java:/comp/env/jdbc/c3p0-kercash-dev','','',0,0,-1,NULL,1);
INSERT INTO REPORT_DATASOURCE VALUES (3,'c3p0-kercash-production','','java:/comp/env/jdbc/c3p0-kercash-production','','',0,0,-1,NULL,1);
INSERT INTO REPORT_DATASOURCE VALUES (6,'c3p0-kercash-warehouse','','java:/comp/env/jdbc/c3p0-kercash-warehouse','','',0,0,0,NULL,1);
Those JNDI-names are for datasources configured at Tomcat context-level. They use c3p0 for connection pooling.
Regards,
Adrian.
Errata:
Instead of:
Second question: I am using OpenReports c3p0-pooled JNDI datasources.
read:
Second question: I am using OpenReports *with* c3p0-pooled JNDI datasources.