/** * Global Transaction */ public void forget(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM) { return; } this.xaImporter.forget(xid); } catch (XAException err) { throw new XATransactionException(QueryPlugin.Event.TEIID30510, err); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void forget(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM) { return; } this.xaTerminator.forget(xid); } catch (XAException err) { throw new XATransactionException(QueryPlugin.Event.TEIID30510, err); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void forget(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM) { return; } this.xaImporter.forget(xid); } catch (XAException err) { throw new XATransactionException(QueryPlugin.Event.TEIID30510, err); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void rollback(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { // In the case of single TM, the container directly roll backs the sources. if (!singleTM) { this.xaTerminator.rollback(tc.getXid()); } } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30508, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void rollback(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { // In the case of single TM, the container directly roll backs the sources. if (!singleTM) { this.xaImporter.rollback(tc.getXid()); } } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30508, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void rollback(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { // In the case of single TM, the container directly roll backs the sources. if (!singleTM) { this.xaImporter.rollback(tc.getXid()); } } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30508, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public int prepare(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); if (!tc.getSuspendedBy().isEmpty()) { throw new XATransactionException(QueryPlugin.Event.TEIID30505, XAException.XAER_PROTO, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30505, xid)); } // In the container this pass though if (singleTM) { return XAResource.XA_RDONLY; } try { return this.xaImporter.prepare(tc.getXid()); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30506, e); } }
/** * Global Transaction */ public int prepare(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); if (!tc.getSuspendedBy().isEmpty()) { throw new XATransactionException(QueryPlugin.Event.TEIID30505, XAException.XAER_PROTO, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30505, xid)); } // In the container this pass though if (singleTM) { return XAResource.XA_RDONLY; } try { return this.xaImporter.prepare(tc.getXid()); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30506, e); } }
/** * Global Transaction */ public void commit(final String threadId, XidImpl xid, boolean onePhase, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM || (onePhase && XAResource.XA_RDONLY == prepare(threadId, xid, singleTM))) { return; //nothing to do } //TODO: we have no way of knowing for sure if we can safely use the onephase optimization this.xaImporter.commit(tc.getXid(), false); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30507, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public int prepare(final String threadId, XidImpl xid, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); if (!tc.getSuspendedBy().isEmpty()) { throw new XATransactionException(QueryPlugin.Event.TEIID30505, XAException.XAER_PROTO, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30505, xid)); } // In the container this pass though if (singleTM) { return XAResource.XA_RDONLY; } try { return this.xaTerminator.prepare(tc.getXid()); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30506, e); } }
/** * Global Transaction */ public void commit(final String threadId, XidImpl xid, boolean onePhase, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM || (onePhase && XAResource.XA_RDONLY == prepare(threadId, xid, singleTM))) { return; //nothing to do } //TODO: we have no way of knowing for sure if we can safely use the onephase optimization this.xaTerminator.commit(tc.getXid(), false); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30507, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void commit(final String threadId, XidImpl xid, boolean onePhase, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, false); try { if (singleTM || (onePhase && XAResource.XA_RDONLY == prepare(threadId, xid, singleTM))) { return; //nothing to do } //TODO: we have no way of knowing for sure if we can safely use the onephase optimization this.xaImporter.commit(tc.getXid(), false); } catch (XAException e) { throw new XATransactionException(QueryPlugin.Event.TEIID30507, e); } finally { this.transactions.removeTransactionContext(tc); } }
/** * Global Transaction */ public void end(final String threadId, XidImpl xid, int flags, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, true); try { switch (flags) { case XAResource.TMSUSPEND: { tc.getSuspendedBy().add(threadId); break; } case XAResource.TMSUCCESS: { //TODO: should close all statements break; } case XAResource.TMFAIL: { cancelTransactions(threadId, false); break; } default: throw new XATransactionException(QueryPlugin.Event.TEIID30520, XAException.XAER_INVAL, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30520)); } } finally { tc.setThreadId(null); transactions.removeTransactionContext(threadId); } }
/** * Global Transaction */ public void end(final String threadId, XidImpl xid, int flags, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, true); try { switch (flags) { case XAResource.TMSUSPEND: { tc.getSuspendedBy().add(threadId); break; } case XAResource.TMSUCCESS: { //TODO: should close all statements break; } case XAResource.TMFAIL: { cancelTransactions(threadId, false); break; } default: throw new XATransactionException(QueryPlugin.Event.TEIID30520, XAException.XAER_INVAL, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30520)); } } finally { tc.setThreadId(null); transactions.removeTransactionContext(threadId); } }
/** * Global Transaction */ public void end(final String threadId, XidImpl xid, int flags, boolean singleTM) throws XATransactionException { TransactionContext tc = checkXAState(threadId, xid, true, true); try { switch (flags) { case XAResource.TMSUSPEND: { tc.getSuspendedBy().add(threadId); break; } case XAResource.TMSUCCESS: { //TODO: should close all statements break; } case XAResource.TMFAIL: { cancelTransactions(threadId, false); break; } default: throw new XATransactionException(QueryPlugin.Event.TEIID30520, XAException.XAER_INVAL, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30520)); } } finally { tc.setThreadId(null); transactions.removeTransactionContext(threadId); } }
case XAResource.TMNOFLAGS: { try { checkXAState(threadId, xid, false, false); tc = transactions.getOrCreateTransactionContext(threadId); if (tc.getTransactionType() != TransactionContext.Scope.NONE) { tc = checkXAState(threadId, xid, true, false); TransactionContext threadContext = transactions.getOrCreateTransactionContext(threadId); if (threadContext.getTransactionType() != TransactionContext.Scope.NONE) {
case XAResource.TMNOFLAGS: { try { checkXAState(threadId, xid, false, false); tc = transactions.getOrCreateTransactionContext(threadId); if (tc.getTransactionType() != TransactionContext.Scope.NONE) { tc = checkXAState(threadId, xid, true, false); TransactionContext threadContext = transactions.getOrCreateTransactionContext(threadId); if (threadContext.getTransactionType() != TransactionContext.Scope.NONE) {
case XAResource.TMNOFLAGS: { try { checkXAState(threadId, xid, false, false); tc = transactions.getOrCreateTransactionContext(threadId); if (tc.getTransactionType() != TransactionContext.Scope.NONE) { tc = checkXAState(threadId, xid, true, false); TransactionContext threadContext = transactions.getOrCreateTransactionContext(threadId); if (threadContext.getTransactionType() != TransactionContext.Scope.NONE) {