Search in sources :

Example 1 with EISSystemException

use of jakarta.resource.spi.EISSystemException in project openmq by eclipse-ee4j.

the class LocalTransaction method commit.

/**
 * Commit a local transaction
 */
@Override
public synchronized void commit() throws ResourceException {
    // System.out.println("MQRA:LT:commit()");
    try {
        if (!xac._isClosed()) {
            xac.getProtocolHandler().commit(transactionID, -1, null);
        } else {
            ResourceException re = new EISSystemException("MQRA:LT:commitTransaction exception:Connection is closed");
            throw re;
        }
    } catch (Exception ex) {
        ResourceException re = new EISSystemException("MQRA:LT:commit exception:" + ex.getMessage());
        re.initCause(ex);
        throw re;
    } finally {
        mc.setLTActive(false);
        started = false;
        active = false;
    }
}
Also used : EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException) EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException)

Example 2 with EISSystemException

use of jakarta.resource.spi.EISSystemException in project openmq by eclipse-ee4j.

the class DirectLocalTransaction method rollback.

/**
 * Rollback a local transaction
 */
@Override
public synchronized void rollback() throws ResourceException {
    // System.out.println("MQRA:LT:rollback()");
    try {
        if (!dc.isClosed()) {
            this.dc._rollbackTransaction("DirectLocalTransaction.rollback()", this.transactionID);
        } else {
            ResourceException re = new EISSystemException("MQRA:LT:rillbackTransaction exception:Connection is closed");
            throw re;
        }
    } catch (Exception ex) {
        ResourceException re = new EISSystemException("MQRA:LT:rollback exception:" + ex.getMessage());
        re.initCause(ex);
        throw re;
    } finally {
        mc.setLTActive(false);
        started = false;
        active = false;
    }
}
Also used : EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException) EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException)

Example 3 with EISSystemException

use of jakarta.resource.spi.EISSystemException in project openmq by eclipse-ee4j.

the class DirectLocalTransaction method begin.

/**
 * Begin a local transaction
 */
@Override
public synchronized void begin() throws ResourceException {
    // System.out.println("MQRA:LT:begin()");
    try {
        if (!dc.isClosed()) {
            transactionID = this.dc._startTransaction("DirectLocalTransaction.begin()");
        } else {
            ResourceException re = new EISSystemException("MQRA:LT:startTransaction exception:Connection is closed");
            throw re;
        }
    // mc.getConnectionAdapter().getSessionAdapter().startLocalTransaction();
    } catch (Exception ex) {
        ResourceException re = new EISSystemException("MQRA:LT:startTransaction exception:" + ex.getMessage());
        re.initCause(ex);
        throw re;
    }
    started = true;
    active = true;
    mc.setLTActive(true);
}
Also used : EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException) EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException)

Example 4 with EISSystemException

use of jakarta.resource.spi.EISSystemException in project openmq by eclipse-ee4j.

the class DirectLocalTransaction method commit.

/**
 * Commit a local transaction
 */
@Override
public synchronized void commit() throws ResourceException {
    // System.out.println("MQRA:LT:commit()");
    try {
        if (!dc.isClosed()) {
            this.dc._commitTransaction("DirectLocalTransaction.commit()", this.transactionID);
        } else {
            ResourceException re = new EISSystemException("MQRA:LT:commitTransaction exception:Connection is closed");
            throw re;
        }
    } catch (Exception ex) {
        ResourceException re = new EISSystemException("MQRA:LT:commit exception:" + ex.getMessage());
        re.initCause(ex);
        throw re;
    } finally {
        mc.setLTActive(false);
        started = false;
        active = false;
    }
}
Also used : EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException) EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException)

Example 5 with EISSystemException

use of jakarta.resource.spi.EISSystemException in project openmq by eclipse-ee4j.

the class LocalTransaction method rollback.

/**
 * Rollback a local transaction
 */
@Override
public synchronized void rollback() throws ResourceException {
    // System.out.println("MQRA:LT:rollback()");
    try {
        if (!xac._isClosed()) {
            xac.getProtocolHandler().rollback(transactionID, null);
        } else {
            ResourceException re = new EISSystemException("MQRA:LT:rollbackTransaction exception:Connection is closed");
            throw re;
        }
    } catch (Exception ex) {
        ResourceException re = new EISSystemException("MQRA:LT:rollback exception:" + ex.getMessage());
        re.initCause(ex);
        throw re;
    } finally {
        mc.setLTActive(false);
        started = false;
        active = false;
    }
}
Also used : EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException) EISSystemException(jakarta.resource.spi.EISSystemException) ResourceException(jakarta.resource.ResourceException)

Aggregations

ResourceException (jakarta.resource.ResourceException)6 EISSystemException (jakarta.resource.spi.EISSystemException)6