public final synchronized void commit(boolean release) throws IOException { if (phase != RUN) throw new IllegalStateException("Can not commit."); if (logmon.isLoggable(BasicLevel.DEBUG)) logmon.log(BasicLevel.DEBUG, "NTransaction, commit(" + release + ')'); Hashtable log = ((Context) perThreadContext.get()).getLog(); if (! log.isEmpty()) { logFile.commit(log); log.clear(); } setPhase(COMMIT); if (logmon.isLoggable(BasicLevel.DEBUG)) logmon.log(BasicLevel.DEBUG, "NTransaction, committed"); if (release) { setPhase(FREE); // wake-up an eventually user's thread in begin notify(); } }
public final synchronized void commit(boolean release) throws IOException { if (phase != RUN) throw new IllegalStateException("Can not commit."); if (logmon.isLoggable(BasicLevel.DEBUG)) logmon.log(BasicLevel.DEBUG, "NTransaction, commit(" + release + ')'); Hashtable<Object, Operation> log = perThreadContext.get().getLog(); if (! log.isEmpty()) { logFile.commit(log); log.clear(); } setPhase(COMMIT); if (logmon.isLoggable(BasicLevel.DEBUG)) logmon.log(BasicLevel.DEBUG, "NTransaction, committed"); if (release) { setPhase(FREE); // wake-up an eventually user's thread in begin notify(); } }