https://bz.apache.org/bugzilla/show_bug.cgi?id=70370
Bug ID: 70370
Summary: Apache Tomcat Version 11.0.29 jdbcInterceptor
StatementCache raises 'The statement is closed.'
Product: Tomcat 11
Version: unspecified
Hardware: All
Status: NEW
Severity: normal
Priority: P2
Component: Util
Assignee: [email protected]
Reporter: [email protected]
Target Milestone: -------
I use Hibernate7.4.5.Final
Migrating from Tomcat JDBC Connection Pool from Version 11.0.26 to 11.0.29
now I get JDBC exception: SQL [The statement is closed.]
See full stack below.
The config I use is:
<property name="hibernate.connection.pool_size" value="20"/>
<property name="hibernate.connection.provider_class"
value="org.hibernate.connection.TomcatJDBCConnectionProvider"/>
<property name="hibernate.connection.release_mode" value="on_close"/>
<property name="hibernate.tomcatJdbcPool.initSQL" value="SET LOCK_TIMEOUT
15000;"/>
<property name="hibernate.tomcatJdbcPool.jmxEnabled" value="true"/>
<property name="hibernate.tomcatJdbcPool.validationQuery" value="SELECT
1"/>
<property name="hibernate.tomcatJdbcPool.maxWait" value="500"/>
<property name="hibernate.tomcatJdbcPool.maxActive" value="20"/>
<property name="hibernate.tomcatJdbcPool.initialSize" value="10"/>
<property name="hibernate.tomcatJdbcPool.minIdle" value="1"/>
<property name="hibernate.tomcatJdbcPool.maxIdle" value="10"/>
<property name="hibernate.tomcatJdbcPool.testOnBorrow" value="true"/>
<property name="hibernate.tomcatJdbcPool.testOnReturn" value="true"/>
<property name="hibernate.tomcatJdbcPool.validationInterval" value="0"/>
<property name="hibernate.tomcatJdbcPool.jdbcInterceptors"
value="StatementCache(prepared=true,callable=false,max=5000)"/>
Another problem is that despite declaring
<property name="hibernate.tomcatJdbcPool.jmxEnabled" value="true"/>
the single JDBC-connections get apparently no more registered:
via mbeans I can only see the tomcatJdbcPool itself beinig registered, while it
currently active connections are no more shown.
Here a complete stacktrace of the exception:
org.hibernate.exception.GenericJDBCException: JDBC exception executing SQL [The
statement is closed.] [select
ccp1_0.OID,ccp1_0.DTYPE,ccp1_0.beforelast_change_date,ccp1_0.create_date,ccp1_0.isChild,ccp1_0.last_change_date,ccp1_0.assClassEnumerations,ccp1_0.assClassWithHooks,ccp1_0.fieldChar,ccp1_0.fieldDouble,ccp1_0.fieldFloat,ccp1_0.fieldLong,ccp1_0.fieldLongLong,ccp1_0.fieldOctet,ccp1_0.fieldShort,ccp1_0.fieldString,ccp1_0.OPTLOCK,ccp1_0.aggClassWithStructs,ccp1_0.assAssociationsClassstartRole,ccp1_0.Attribute1
from BasicTypes ccp1_0 where (ccp1_0.create_date>=? and
ccp1_0.DTYPE='ConcreteClass') and ccp1_0.DTYPE in
('ConcreteClass','ConcreteSubclass')]
at
org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:39)
at
org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:115)
at
org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:292)
at
org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.getResultSet(DeferredResultSetAccess.java:188)
at
org.hibernate.sql.results.jdbc.internal.JdbcValuesResultSetImpl.<init>(JdbcValuesResultSetImpl.java:71)
at
org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.resolveJdbcValues(JdbcSelectExecutorStandardImpl.java:422)
at
org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.resolveJdbcValuesSource(JdbcSelectExecutorStandardImpl.java:349)
at
org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.doExecuteQuery(JdbcSelectExecutorStandardImpl.java:143)
at
org.hibernate.sql.exec.internal.JdbcSelectExecutorStandardImpl.executeQuery(JdbcSelectExecutorStandardImpl.java:100)
at
org.hibernate.sql.exec.spi.JdbcSelectExecutor.executeQuery(JdbcSelectExecutor.java:63)
at
org.hibernate.sql.exec.spi.JdbcSelectExecutor.list(JdbcSelectExecutor.java:137)
at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.lambda$new$1(ConcreteSqmSelectQueryPlan.java:136)
at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.withCacheableSqmInterpretation(ConcreteSqmSelectQueryPlan.java:484)
at
org.hibernate.query.sqm.internal.ConcreteSqmSelectQueryPlan.performList(ConcreteSqmSelectQueryPlan.java:411)
at
org.hibernate.query.sqm.internal.SqmQueryImpl.doList(SqmQueryImpl.java:379)
at
org.hibernate.query.spi.AbstractSelectionQuery.list(AbstractSelectionQuery.java:153)
at
com.wuerth.phoenix.bcserver.base.PhoenixQuery.callQuery(PhoenixQuery.java:1196)
at
com.wuerth.phoenix.bcserver.base.PhoenixQuery.executeSelect(PhoenixQuery.java:1159)
at
com.wuerth.phoenix.bcserver.base.IteratorFactoryImpl.getSelect(IteratorFactoryImpl.java:55)
at
com.wuerth.phoenix.test.bc.AbstractTestJUnit.executeQuery(AbstractTestJUnit.java:474)
at
com.wuerth.phoenix.test.bart.query.peers.QueryTest.executeQuery(QueryTest.java:963)
at
com.wuerth.phoenix.test.bart.query.peers.QueryTest.testQueryDeleteNextBatchSelect(QueryTest.java:143)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at junit.framework.TestCase.runTest(TestCase.java:176)
at junit.framework.TestCase.runBare(TestCase.java:141)
at junit.framework.TestResult$1.protect(TestResult.java:122)
at junit.framework.TestResult.runProtected(TestResult.java:142)
at junit.framework.TestResult.run(TestResult.java:125)
at junit.framework.TestCase.run(TestCase.java:129)
at junit.framework.TestSuite.runTest(TestSuite.java:255)
at junit.framework.TestSuite.run(TestSuite.java:250)
at
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
at
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:93)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:520)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:748)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:443)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:211)
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The statement is
closed.
at
com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(SQLServerException.java:242)
at
com.microsoft.sqlserver.jdbc.SQLServerStatement.checkClosed(SQLServerStatement.java:1131)
at
com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.setTimestamp(SQLServerPreparedStatement.java:1888)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at
org.apache.tomcat.jdbc.pool.interceptor.StatementDecoratorInterceptor$StatementProxy.invoke(StatementDecoratorInterceptor.java:426)
at
org.apache.tomcat.jdbc.pool.interceptor.StatementCache$CachedStatement.invoke(StatementCache.java:843)
at jdk.proxy2/jdk.proxy2.$Proxy16.setTimestamp(Unknown Source)
at
java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at
org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:237)
at jdk.proxy2/jdk.proxy2.$Proxy16.setTimestamp(Unknown Source)
at
org.hibernate.type.descriptor.jdbc.TimestampJdbcType$1.doBind(TimestampJdbcType.java:85)
at
org.hibernate.type.descriptor.jdbc.BasicBinder.bind(BasicBinder.java:60)
at
org.hibernate.sql.exec.internal.AbstractJdbcParameter.bindParameterValue(AbstractJdbcParameter.java:121)
at
org.hibernate.sql.exec.internal.AbstractJdbcParameter.bindParameterValue(AbstractJdbcParameter.java:90)
at
org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.bindParameters(DeferredResultSetAccess.java:210)
at
org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:257)
... 36 more
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]