protected void setIsolationLevel ( int isolationLevel ) throws IsolationLevelChangeException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "current isolation level = " + MethodAttribUtils . getIsolationLevelString ( ivIsolationLevel ) + ", attempting to change to = " + MethodAttribUtils . getIsolationLevelString ( isolationLevel ) ) ; // PK31372 } // Treat TRANSACTION_NONE as "don't care". The current value may be // NONE because it hasn't been set yet, or because all the methods // invoked so far did not have an isolation level specified by // the customer (in the deployment descriptor). d107762 if ( ivIsolationLevel == java . sql . Connection . TRANSACTION_NONE ) { ivIsolationLevel = isolationLevel ; } else if ( ivIsolationLevel != isolationLevel && isolationLevel != java . sql . Connection . TRANSACTION_NONE ) { throw new IsolationLevelChangeException ( ) ; } }
Set the isolation level for the current transacion and ensure that it has not changed within the transaction .