public final void enforceAutoCommit ( boolean autoCommit ) throws SQLException { final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( this , tc , "enforceAutoCommit" , autoCommit ) ; // Only set values if the requested value is different from the current value, // or if required as a workaround. if ( autoCommit != currentAutoCommit || helper . alwaysSetAutoCommit ( ) ) { if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "currentAutoCommit: " + currentAutoCommit + " --> " + autoCommit ) ; sqlConn . setAutoCommit ( autoCommit ) ; currentAutoCommit = autoCommit ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . exit ( this , tc , "enforceAutoCommit" ) ; } }
Enforce the autoCommit setting in the underlying database and update the current value on the MC . This method must be invoked by the Connection handle before doing any work on the database .