title: Oracle JDBC connection with Weblogic 10 datasource mapping, giving problem java.sql.SQLException: Closed Connection
body: <p>Oracle JDBC connection with Weblogic 10 datasource mapping, giving problem java.sql.SQLException: Closed Connection</p>
  
  <p>I am using weblogic 10 JNDI datasource to create JDBC connections, below is my config</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;jdbc-data-source xmlns="http://www.bea.com/ns/weblogic/90" xmlns:sec="http://www.bea.com/ns/weblogic/90/security" xmlns:wls="http://www.bea.com/ns/weblogic/90/security/wls" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/920 http://www.bea.com/ns/weblogic/920.xsd"&gt;
    &lt;name&gt;XL-Reference-DS&lt;/name&gt;
    &lt;jdbc-driver-params&gt;
      &lt;url&gt;jdbc:oracle:oci:@abc.XL.COM&lt;/url&gt;
      &lt;driver-name&gt;oracle.jdbc.driver.OracleDriver&lt;/driver-name&gt;
      &lt;properties&gt;
        &lt;property&gt;
          &lt;name&gt;user&lt;/name&gt;
          &lt;value&gt;DEV_260908&lt;/value&gt;
        &lt;/property&gt;
        &lt;property&gt;
          &lt;name&gt;password&lt;/name&gt;
          &lt;value&gt;password&lt;/value&gt;
        &lt;/property&gt; 
        &lt;property&gt;
          &lt;name&gt;dll&lt;/name&gt;
          &lt;value&gt;ocijdbc10&lt;/value&gt;
        &lt;/property&gt;
        &lt;property&gt;
          &lt;name&gt;protocol&lt;/name&gt;
          &lt;value&gt;oci&lt;/value&gt;
        &lt;/property&gt; 
        &lt;property&gt;
          &lt;name&gt;oracle.jdbc.V8Compatible&lt;/name&gt;
          &lt;value&gt;true&lt;/value&gt;
        &lt;/property&gt;
        &lt;property&gt;
          &lt;name&gt;baseDriverClass&lt;/name&gt;
          &lt;value&gt;oracle.jdbc.driver.OracleDriver&lt;/value&gt;
        &lt;/property&gt;
      &lt;/properties&gt;
    &lt;/jdbc-driver-params&gt;
    &lt;jdbc-connection-pool-params&gt;
      &lt;initial-capacity&gt;1&lt;/initial-capacity&gt;
      &lt;max-capacity&gt;100&lt;/max-capacity&gt;
      &lt;capacity-increment&gt;1&lt;/capacity-increment&gt;
      &lt;test-connections-on-reserve&gt;true&lt;/test-connections-on-reserve&gt;
      &lt;test-table-name&gt;SQL SELECT 1 FROM DUAL&lt;/test-table-name&gt;
    &lt;/jdbc-connection-pool-params&gt;
    &lt;jdbc-data-source-params&gt;
      &lt;jndi-name&gt;ReferenceData&lt;/jndi-name&gt;
      &lt;global-transactions-protocol&gt;OnePhaseCommit&lt;/global-transactions-protocol&gt;
    &lt;/jdbc-data-source-params&gt;
  &lt;/jdbc-data-source&gt;
  </code></pre>
  
  <p>When I run a bulk task where there are lots of connections made and closed, sometimes it gives connection closed exception for any of the task in the bulk task.</p>
  
  <p>Below is detailed exception'</p>
  
  <pre><code>java.sql.SQLException: Closed Connection
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:145)
   at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:207)
   at oracle.jdbc.driver.OracleStatement.ensureOpen(OracleStatement.java:3512)
   at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3265)
   at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3367)
  </code></pre>
  
  <p>Any ideas? </p>