1 Reply Latest reply on Jan 21, 2013 5:17 PM by Joe Weinstein-Oracle

    JDBC Config - Inactive Connection Timeout for Batch Process


      I have been facing issue in 2 of the batch processeses when Inactive Connection Timeout of connection pool is set as 30 sec. I am not sure from when timeout count down starts. My batch takes around 10 min to complete. Code looks as below

      cstmt=(CallableStatement)conn.prepareCall("{call someBatchProcess(?, ?, ?, ?) }");
      cstmt.setString(1, strUserCode);
      cstmt.setString(2, strBatchName);
      cstmt.registerOutParameter(3, java.sql.Types.DOUBLE);
      cstmt.registerOutParameter(4, java.sql.Types.VARCHAR);

      int retCode=cstmt.getLong(3);
      String retMessage = cstmt.getString(4);

      In the log I see simetimes connection is getting closed (<Forcibly releasinng the connection....>) just before calling getLong and sometimes before calling getString and thus these calls fails with "Statement Already Closed" .

      So should I increase the inactive timout to 900 sec, but I suppose then this is not the expected behavior. I believe timeout should start after execute() returns.

      Weblogic version is and Oracle DB is 11GR2.


      Edited by: 983103 on Jan 21, 2013 3:50 AM
        • 1. Re: JDBC Config - Inactive Connection Timeout for Batch Process
          Joe Weinstein-Oracle
          Inactive timeouts should occur only if your code has not used the JDBC connection (or one of it's subobjects) for that long. Even if your code is simply waiting for a query to return results from the DBMS, or for a ResultSet to respond, that is considered active. It should be only for truly inactive JDBC connections that your timeout will trigger. It is only you who can know if your code has long periods of non-JDBC processing while you're still holding on to (and perhaps needing) a JDBC connection.

          Edited by: Joe Weinstein on Jan 21, 2013 9:16 AM