public Object notSupported(final TransactionCallback callback) throws Throwable { final Transaction tx = suspend(); try { return callback.execute(this); } finally { if (tx != null) { resume(tx); } } }
public Object required(final TransactionCallback callback) throws Throwable { final boolean began = begin(); try { return callback.execute(this); } finally { if (began) { end(); } } }
public Object requiresNew(final TransactionCallback callback) throws Throwable { final Transaction tx = suspend(); try { begin(); try { return callback.execute(this); } finally { end(); } } finally { if (tx != null) { resume(tx); } } }
public Object mandatory(final TransactionCallback callback) throws Throwable { if (!hasTransaction()) { throw new SIllegalStateException("ESSR0311", null); } return callback.execute(this); }