public void startTransaction() { boolean noneInProgress = false; if (getTransaction() == null || getTransaction().getState().isComplete()) { noneInProgress = true; createTransaction(); transactionLevel = 0; objectStore.startTransaction(); } transactionLevel++; if (LOG.isInfoEnabled()) { LOG.info( "startTransaction: level " + (transactionLevel-1) + "->" + (transactionLevel) + (noneInProgress?" (no transaction in progress or was previously completed; transaction created)":"")); } }
protected void ensureTransactionInProgress() { ensureThatState( getTransaction() != null && !getTransaction().getState().isComplete(), is(true), "No transaction in progress"); }
protected void ensureTransactionNotInProgress() { ensureThatState( getTransaction() != null && !getTransaction().getState().isComplete(), is(false), "Transaction in progress"); }
public boolean inTransaction() { return getTransaction() != null && !getTransaction().getState().isComplete(); }
public static boolean inTransaction() { return inSession() && getCurrentTransaction() != null && !getCurrentTransaction().getState().isComplete(); }