/** * Accessor for whether the transaction is active * @return Whether it is active */ public boolean isActive() { return tx.isActive(); }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Mutator for the rollback-only setting */ public void setRollbackOnly() { if (tx.isActive()) { // Only apply to active transactions tx.setRollbackOnly(); } }
/** * Asserts that the transaction is not in use. */ protected void assertNotInUse() { if (tx.isActive()) { throw new TransactionActiveException(this); } }
/** * Indicate whether a transaction is in progress. * @throws PersistenceException if an unexpected error condition is encountered. */ public boolean isActive() { return om.getTransaction().isActive(); }
/** * Convenience method to throw an exception if the transaction is not active. * @throws IllegalStateException Thrown if the transaction is not active. */ protected void assertActive() { if (!om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015040")); } }
/** * Convenience method to throw an exception if the transaction is active. * @throws IllegalStateException Thrown if the transaction is active. */ protected void assertNotActive() { if (om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015032")); } } }
/** * Convenience method to throw an exception if the transaction is not active. * @throws IllegalStateException Thrown if the transaction is not active. */ protected void assertActive() { if (!om.getTransaction().isActive()) { throw new IllegalStateException(LOCALISER.msg("015040")); } } }
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Disconnect the query from this ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
/** * Method to assert if the current transaction is active. * Throws a TransactionNotActiveException if not active. */ protected void assertActiveTransaction() { if (!ec.getTransaction().isActive()) { throw new TransactionNotActiveException(); } }
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
public void managedConnectionPreClose() { if (!ec.getTransaction().isActive()) { // Non-Tx : disconnect query from ManagedConnection (read in unread rows etc) qr1.disconnect(); } } public void managedConnectionPostClose(){}
/** * Method to assert if the current transaction is active or non transactional writes are allowed. * Throws a TransactionNotWritableException if not active and non transactional writes are disabled */ protected void assertWritable() { if (!ec.getTransaction().isActive() && !ec.getTransaction().getNontransactionalWrite()) { throw new TransactionNotWritableException(); } }
/** * Method to transition when serialised. * @param op ObjectProvider * @return The new LifeCycle state */ public LifeCycleState transitionSerialize(ObjectProvider op) { Transaction tx = op.getExecutionContext().getTransaction(); if (tx.isActive() && !tx.getOptimistic()) { return changeState(op, P_CLEAN); } return this; }
/** * @param op The ObjectProvider * @see LifeCycleState#transitionWriteField(ObjectProvider op) */ public LifeCycleState transitionWriteField(ObjectProvider op) { Transaction tx = op.getExecutionContext().getTransaction(); if (tx.isActive()) { op.saveFields(); return changeTransientState(op,T_DIRTY); } return this; }
/** * Method to assert if no active transaction and nontransactionalRead is not set. * Throws JDOUserException if the tx is not active and no non-transactional read is available * @param operation The operation */ protected void assertReadable(String operation) { if (!ec.getTransaction().isActive() && !ec.getTransaction().getNontransactionalRead()) { throw new JDOUserException(Localiser.msg("011001", operation)); } }