jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julian Reschke (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OAK-6237) Tomcat JDBC pool's StatementCache interceptor may cache borked PreparedStatements with DB2
Date Wed, 27 Sep 2017 17:44:00 GMT

     [ https://issues.apache.org/jira/browse/OAK-6237?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Julian Reschke updated OAK-6237:
--------------------------------
    Fix Version/s: 1.4.19

> Tomcat JDBC pool's StatementCache interceptor may cache borked PreparedStatements with
DB2
> ------------------------------------------------------------------------------------------
>
>                 Key: OAK-6237
>                 URL: https://issues.apache.org/jira/browse/OAK-6237
>             Project: Jackrabbit Oak
>          Issue Type: Technical task
>          Components: rdbmk
>            Reporter: Julian Reschke
>            Assignee: Julian Reschke
>              Labels: candidate_oak_1_0, candidate_oak_1_2, candidate_oak_1_4
>             Fix For: 1.8, 1.7.9, 1.4.19, 1.6.6
>
>         Attachments: OAK-6237.diff
>
>
> {noformat}
> (cd oak-store-document; mvn clean install -Prdb-db2 -Dtest=RDBBlobStoreTest)
> {noformat}
> fails with:
> {noformat}
> [ERROR] testDeleteChunks[MyFixture: RDB-DB2](org.apache.jackrabbit.oak.plugins.document.blob.RDBBlobStoreTest)
 Time elapsed: 0.069 s  <<< ERROR!
> com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][10145][10844][4.16.53] Invalid parameter
1: Parameter index is out of range. ERRORCODE=-4461, SQLSTATE=42815
>         at org.apache.jackrabbit.oak.plugins.document.blob.RDBBlobStoreTest.testDeleteChunks(RDBBlobStoreTest.java:219)
> {noformat}
> Stack trace:
> {noformat}
> com.ibm.db2.jcc.am.SqlSyntaxErrorException: [jcc][10145][10844][4.16.53] Invalid parameter
1: Parameter index is out of range. ERRORCODE=-4461, SQLSTATE=42815
> 	at com.ibm.db2.jcc.am.fd.a(fd.java:739)
> 	at com.ibm.db2.jcc.am.fd.a(fd.java:60)
> 	at com.ibm.db2.jcc.am.fd.a(fd.java:103)
> 	at com.ibm.db2.jcc.am.uo.l(uo.java:5982)
> 	at com.ibm.db2.jcc.am.uo.j(uo.java:5937)
> 	at com.ibm.db2.jcc.am.uo.a(uo.java:1606)
> 	at com.ibm.db2.jcc.am.uo.setString(uo.java:1595)
> 	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.apache.tomcat.jdbc.pool.interceptor.StatementDecoratorInterceptor$StatementProxy.invoke(StatementDecoratorInterceptor.java:261)
> 	at com.sun.proxy.$Proxy12.setString(Unknown Source)
> 	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.apache.tomcat.jdbc.pool.interceptor.AbstractQueryReport$StatementProxy.invoke(AbstractQueryReport.java:235)
> 	at com.sun.proxy.$Proxy12.setString(Unknown Source)
> 	at org.apache.jackrabbit.oak.plugins.document.rdb.RDBPreparedStatementWrapper.setString(RDBPreparedStatementWrapper.java:552)
> 	at org.apache.jackrabbit.oak.plugins.document.rdb.RDBBlobStoreFriend.isDataEntryPresent(RDBBlobStoreFriend.java:62)
> 	at org.apache.jackrabbit.oak.plugins.document.blob.RDBBlobStoreTest.testDeleteChunks(RDBBlobStoreTest.java:219)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
> 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
> 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at org.junit.runners.Suite.runChild(Suite.java:128)
> 	at org.junit.runners.Suite.runChild(Suite.java:27)
> 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
> 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
> 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
> 	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
> 	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:678)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
> 	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
> {noformat}
> The test case is:
> {noformat}
>     public static boolean isDataEntryPresent(RDBBlobStore ds, byte[] digest) throws Exception
{
>         String id = StringUtils.convertBytesToHex(digest);
>         Connection con = ds.ch.getROConnection();
>         PreparedStatement prep = null;
>         ResultSet rs = null;
>         try {
>             prep = con.prepareStatement("select ID from " + ds.tnData + " where ID =
?");
>             prep.setString(1, id);
>             rs = prep.executeQuery();
>             return rs.next();
>         } finally {
>             closeResultSet(rs);
>             closeStatement(prep);
>             con.commit();
>             ds.ch.closeConnection(con);
>         }
>     }
> {noformat}
> so clearly there is a parameter 1.
> Disabling the tomcat JDBC statement cache fixes the issue:
> {noformat}
> (cd oak-store-document; mvn clean install -Prdb-db2 -Dtest=RDBBlobStoreTest -Dorg.apache.jackrabbit.oak.plugins.document.rdb.RDBDataSourceFactory.jdbcInterceptors=)
> {noformat}
> Upgrading to the latest 7.x connection pool (7.0.77) doesn't seem to fix the problem.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message