Search in sources :

Example 1 with RollbackFailedException

use of org.jaffa.persistence.exceptions.RollbackFailedException in project jaffa-framework by jaffa-projects.

the class UOW method rollback.

/**
 * Rollbacks all the additions, deletions, updations.
 * Note: This object will free up its connection to the database, and will no longer be available.
 *
 * @throws RollbackFailedException if any error occurs during the process.
 */
public void rollback() throws RollbackFailedException {
    if (isActive()) {
        RollbackFailedException ex = null;
        try {
            m_engine.rollback();
        } catch (RollbackFailedException e) {
            ex = e;
        }
        if (m_messagingEngine != null) {
            try {
                m_messagingEngine.rollback();
            } catch (Exception e) {
                ex = new RollbackFailedException(null, e);
            }
        }
        // Close the connection, no matter what
        close();
        if (ex != null)
            throw ex;
    }
}
Also used : RollbackFailedException(org.jaffa.persistence.exceptions.RollbackFailedException) InvalidUowRuntimeException(org.jaffa.persistence.exceptions.InvalidUowRuntimeException) UpdateFailedException(org.jaffa.persistence.exceptions.UpdateFailedException) DeleteFailedException(org.jaffa.persistence.exceptions.DeleteFailedException) UOWException(org.jaffa.persistence.exceptions.UOWException) CommitFailedException(org.jaffa.persistence.exceptions.CommitFailedException) PostLoadFailedException(org.jaffa.persistence.exceptions.PostLoadFailedException) FrameworkException(org.jaffa.exceptions.FrameworkException) AddFailedException(org.jaffa.persistence.exceptions.AddFailedException) InactiveUowRuntimeException(org.jaffa.persistence.exceptions.InactiveUowRuntimeException) QueryFailedException(org.jaffa.persistence.exceptions.QueryFailedException) AlreadyLockedObjectException(org.jaffa.persistence.exceptions.AlreadyLockedObjectException) RollbackFailedException(org.jaffa.persistence.exceptions.RollbackFailedException)

Aggregations

FrameworkException (org.jaffa.exceptions.FrameworkException)1 AddFailedException (org.jaffa.persistence.exceptions.AddFailedException)1 AlreadyLockedObjectException (org.jaffa.persistence.exceptions.AlreadyLockedObjectException)1 CommitFailedException (org.jaffa.persistence.exceptions.CommitFailedException)1 DeleteFailedException (org.jaffa.persistence.exceptions.DeleteFailedException)1 InactiveUowRuntimeException (org.jaffa.persistence.exceptions.InactiveUowRuntimeException)1 InvalidUowRuntimeException (org.jaffa.persistence.exceptions.InvalidUowRuntimeException)1 PostLoadFailedException (org.jaffa.persistence.exceptions.PostLoadFailedException)1 QueryFailedException (org.jaffa.persistence.exceptions.QueryFailedException)1 RollbackFailedException (org.jaffa.persistence.exceptions.RollbackFailedException)1 UOWException (org.jaffa.persistence.exceptions.UOWException)1 UpdateFailedException (org.jaffa.persistence.exceptions.UpdateFailedException)1