Example usage for javax.transaction.xa XAException XAER_INVAL

List of usage examples for javax.transaction.xa XAException XAER_INVAL

Introduction

In this page you can find the example usage for javax.transaction.xa XAException XAER_INVAL.

Prototype

int XAER_INVAL

To view the source code for javax.transaction.xa XAException XAER_INVAL.

Click Source Link

Document

Invalid arguments were given.

Usage

From source file:org.nuxeo.ecm.core.blob.storage.impl.XASession.java

public void end(Xid xid, int flags) throws XAException {
    TransactionContext tx = (TransactionContext) transactions.get(xid);
    if (tx == null) {
        throw new XAException(XAException.XAER_NOTA);
    }/* ww w .j a  v a 2s  .c  om*/
    if (flags == TMSUSPEND) {
        if (!isAssociated()) {
            log.error("Resource not associated with a transaction.");
            throw new XAException(XAException.XAER_PROTO);
        }
        associate(null);
        tx.setSuspended(true);
    } else if (flags == TMFAIL || flags == TMSUCCESS) {
        if (!tx.isSuspended()) {
            if (!isAssociated()) {
                log.error("Resource not associated with a transaction.");
                throw new XAException(XAException.XAER_PROTO);
            }
            associate(null);
        } else {
            tx.setSuspended(false);
        }
    } else {
        throw new XAException(XAException.XAER_INVAL);
    }
}