List of usage examples for javax.transaction.xa XAException initCause
public synchronized Throwable initCause(Throwable cause)
From source file:org.nuxeo.ecm.core.blob.storage.impl.XASession.java
public int prepare(Xid xid) throws XAException { TransactionContext tx = (TransactionContext) transactions.get(xid); if (tx == null) { throw new XAException(XAException.XAER_NOTA); }/*from ww w . ja v a 2s . com*/ try { tx.prepare(); } catch (ResourceException e) { XAException ee = new XAException(XAException.XAER_RMERR); ee.initCause(e); throw ee; } return XA_OK; }
From source file:org.nuxeo.ecm.core.blob.storage.impl.XASession.java
public void rollback(Xid xid) throws XAException { TransactionContext tx = (TransactionContext) transactions.get(xid); if (tx == null) { throw new XAException(XAException.XAER_NOTA); }/*from w w w . j a v a 2 s . c om*/ try { tx.rollback(); } catch (ResourceException e) { XAException ee = new XAException(XAException.XAER_RMERR); ee.initCause(e); throw ee; } transactions.remove(xid); }