private int prepareConnectionForBatch ( Connection conn ) throws SQLException { conn . setAutoCommit ( false ) ; int initialIsolation = Connection . TRANSACTION_REPEATABLE_READ ; if ( _isDB2 ) { try { initialIsolation = conn . getTransactionIsolation ( ) ; if ( Connection . TRANSACTION_REPEATABLE_READ != initialIsolation && Connection . TRANSACTION_SERIALIZABLE != initialIsolation ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Transaction isolation level was " + initialIsolation + " , setting to TRANSACTION_REPEATABLE_READ" ) ; conn . setTransactionIsolation ( Connection . TRANSACTION_REPEATABLE_READ ) ; } } catch ( Exception e ) { if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "setTransactionIsolation to RR threw Exception. Transaction isolation level was " + initialIsolation + " " , e ) ; FFDCFilter . processException ( e , "com.ibm.ws.recoverylog.spi.SQLMultiScopeRecoveryLog.prepareConnectionForBatch" , "3668" , this ) ; if ( ! isolationFailureReported ) { isolationFailureReported = true ; Tr . warning ( tc , "CWRLS0024_EXC_DURING_RECOVERY" , e ) ; } // returning RR will prevent closeConnectionAfterBatch resetting isolation level initialIsolation = Connection . TRANSACTION_REPEATABLE_READ ; } } return initialIsolation ; }
Sets AutoCommit and Isolation level for the connection