public void reset ( ) throws SQLException { boolean useComReset = options . useResetConnection && ( ( protocol . isServerMariaDb ( ) && protocol . versionGreaterOrEqual ( 10 , 2 , 4 ) ) || ( ! protocol . isServerMariaDb ( ) && protocol . versionGreaterOrEqual ( 5 , 7 , 3 ) ) ) ; if ( useComReset ) { protocol . reset ( ) ; } if ( stateFlag != 0 ) { try { if ( ( stateFlag & ConnectionState . STATE_NETWORK_TIMEOUT ) != 0 ) { setNetworkTimeout ( null , options . socketTimeout ) ; } if ( ( stateFlag & ConnectionState . STATE_AUTOCOMMIT ) != 0 ) { setAutoCommit ( options . autocommit ) ; } if ( ( stateFlag & ConnectionState . STATE_DATABASE ) != 0 ) { protocol . resetDatabase ( ) ; } if ( ( stateFlag & ConnectionState . STATE_READ_ONLY ) != 0 ) { setReadOnly ( false ) ; //default to master connection } //COM_RESET_CONNECTION reset transaction isolation if ( ! useComReset && ( stateFlag & ConnectionState . STATE_TRANSACTION_ISOLATION ) != 0 ) { setTransactionIsolation ( defaultTransactionIsolation ) ; } stateFlag = 0 ; } catch ( SQLException sqle ) { throw ExceptionMapper . getSqlException ( "error resetting connection" ) ; } } warningsCleared = true ; }
Reset connection set has it was after creating a fresh new connection . defaultTransactionIsolation must have been initialized .