private void resolveIncompleteTransactions ( ) throws SQLException { switch ( transactionState ) { case COMPLETED : //All we know for certain is that at least one commit/rollback was called. Do nothing. break ; case STARTED : //At least one statement was created with auto-commit false & no commit/rollback. //Follow the default policy. if ( conn != null && openStatements . size ( ) > 0 ) { switch ( incompleteTransactionPolicy ) { case REPORT : throw new SQLException ( "Statement closed with incomplete transaction" , JDBConnection . SQLSTATE_INVALID_TRANSACTION_STATE ) ; case COMMIT : if ( ! conn . isClosed ( ) ) { conn . commit ( ) ; } break ; case ROLLBACK : if ( ! conn . isClosed ( ) ) { conn . rollback ( ) ; } } } break ; } }
Attempt to deal with any transaction problems .