public final void flush() { ensureThatState(getState().canFlush(), is(true), "state is: " + getState()); if (LOG.isInfoEnabled()) { LOG.info("flush transaction " + this); } try { doFlush(); } catch(RuntimeException ex) { setState(State.MUST_ABORT); setAbortCause(ex); throw ex; } }
public final void abort() { ensureThatState(getState().canAbort(), is(true), "state is: " + getState()); if (LOG.isInfoEnabled()) { LOG.info("abort transaction " + this); } try { doAbort(); } catch(RuntimeException ex) { setAbortCause(ex); throw ex; } finally { setState(State.ABORTED); } }
public final void commit() { ensureThatState(getState().canCommit(), is(true), "state is: " + getState()); if (LOG.isInfoEnabled()) { LOG.info("commit transaction " + this); } if (getState() == State.COMMITTED) { if (LOG.isInfoEnabled()) { LOG.info("already committed; ignoring"); } return; } try { doFlush(); setState(State.COMMITTED); } catch(RuntimeException ex) { setAbortCause(ex); throw ex; } }