commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eugene Krylov (JIRA)" <>
Subject [jira] Created: (DBCP-293) Closed statement exception using Oracle 11g and JDK Jrockit 1.6
Date Tue, 09 Jun 2009 17:28:10 GMT
Closed statement exception using Oracle 11g and JDK Jrockit 1.6

                 Key: DBCP-293
             Project: Commons Dbcp
          Issue Type: Bug
    Affects Versions: 1.2.1
         Environment: dbcp 1.2.1
Oracle 11g, 
oracle driver from weblogic 10.3 distribution  server/ext/jdbc/oracle/11g/ojdbc6.jar, 
$ java -version
java version "1.6.0_05"
Java(TM) SE Runtime Environment (build 1.6.0_05-b13)
BEA JRockit(R) (build R27.6.0-50_o-100423-1.6.0_05-20080626-2104-linux-ia32, compiled mode)
            Reporter: Eugene Krylov

After upgrade to latest version of weblogic which now includes jdk 1.6 I am running into an
exception where statements appear to be closed but still reside in the statement cache. It
appears related to transaction rollback and closing of connection for which statement was
originally prepared. Exception stack is as follows:
 java.sql.SQLException: Closed Statement
        at oracle.jdbc.driver.SQLStateMapping.newSQLException(
        at oracle.jdbc.driver.DatabaseError.newSQLException(
        at oracle.jdbc.driver.DatabaseError.throwSqlException(
        at oracle.jdbc.driver.DatabaseError.throwSqlException(
        at oracle.jdbc.driver.DatabaseError.throwSqlException(
        at oracle.jdbc.driver.OracleClosedStatement.setQueryTimeout(
        at oracle.jdbc.driver.OracleStatementWrapper.setQueryTimeout(
        at org.apache.commons.dbcp.DelegatingStatement.setQueryTimeout(
        at org.apache.commons.dbcp.DelegatingStatement.setQueryTimeout(
        at com.healthedge.j2ee.DBConnectionImpl.prepareStatement(

Jocl file looks like this:
<?xml version="1.0"?>
<object class="org.apache.commons.dbcp.PoolableConnectionFactory" xmlns="">
      The first argument to PoolableConnectionFactory is a ConnectionFactory.
      We'll use a DriverManagerConnectionFactory, passing in the appropriate
      connect string for the underlying driver.
   <object class="org.apache.commons.dbcp.DriverManagerConnectionFactory">
      <string value="jdbc:oracle:thin:@localhost:1521:orcl"/>
      <string value="schema"/>
      <string value="password"/>

      The next argument is the pool to use.  We'll use a StackObjectPool,
      although any implementation of ObjectPool should suffice.
      Since we are running on single connection from the client anyway,
      there is not a need to tune this to perfection.
   <object class="org.apache.commons.pool.impl.StackObjectPool"/>
      The next argument is the KeyedObjectPoolFactory to use to create pools
      for storing PreparedStatements.  This functionality is optional, it can
      be disabled by using the line below.

   <object class="org.apache.commons.pool.KeyedObjectPoolFactory" null="true"/>


   <object class="org.apache.commons.pool.impl.GenericKeyedObjectPoolFactory">
      <object class="org.apache.commons.pool.KeyedPoolableObjectFactory" null="true"/>
      <int value="20"/>    
      <byte value="2"/>    
      <long value="2000"/> 
      <int value="200"/>   
      <int value="300"/>   

      The next argument is the query to use to validate that a Connection is
      still up and running.  It should return at least one row.
      This functionality is optional. We'll just set it to null.
   <string null="true"/> 
   <string value="select 1 from age_range"/> 
   <boolean value="false"/> <!-- The default "read only" value for Connections. -->

   <boolean value="false"/> <!-- The default "auto commit" value for Connections.

Disabling statement cache eliminates the exception. 

This is my first time reporting an issue in this forum, so if I filed it in a wrong place
please let me know. I searched bugs, but have not found anything that would be similar to

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message