throw new CannotAbortException();
public void rollback(Xid xid) throws XAException { if (_logger.isLoggable(Level.FINE)) { _logger.log(Level.FINE, "XAResourceImpl:rollback(), the Xid is:" + xid + " rmid=" + _rmid + " thread=" + Thread.currentThread().getId()); } xid = createGSXid(xid); try { m_txnManger.abort(xid, COMMIT_ABORT_DEFAULT_TIMEOUT); } catch (UnknownTransactionException e) { if (failOnInvalidRollback) _logger.log(Level.SEVERE, "XAResourceImpl:rollback() , unknownTxnException rmid=" + _rmid + " thread=" + Thread.currentThread().getId() + " exception:" + e + e.getStackTrace()); throw createsXAException(XAException.XA_RBPROTO, e); } catch (CannotAbortException e) { _logger.log(Level.SEVERE, "XAResourceImpl:rollback() , CannotAbortException rmid=" + _rmid + " thread=" + Thread.currentThread().getId() + " exception:" + e + e.getStackTrace()); throw createsXAException(XAException.XA_RBPROTO, e); } catch (RemoteException e) { _logger.log(Level.SEVERE, "XAResourceImpl:rollback() , remoteException rmid=" + _rmid + " thread=" + Thread.currentThread().getId() + " exception:" + e + e.getStackTrace()); throw createsXAException(XAException.XA_RBCOMMFAIL, e); } catch (TimeoutExpiredException e) { _logger.log(Level.SEVERE, "XAResourceImpl:rollback() , timeoutException rmid=" + _rmid + " thread=" + Thread.currentThread().getId() + " exception:" + e + e.getStackTrace()); throw createsXAException(XAException.XAER_RMFAIL, e); } finally { _activeEmptyTransactions.remove(xid); _suspendedXtns.remove(xid); if (_resourcePerSingleTxn) _relevantTx = false; } }
private void lightAbort(ParticipantHandle singleHandle) throws CannotAbortException, TimeoutExpiredException { TxnMgrProxy cur = (TxnMgrProxy) str.mgr; try { if (getState() == ABORTED) return; if (modifyTxnState(ABORTED)) { if (singleHandle.isSuitableForCommitFailover()) { AbortJob.abortPartitionWithEnabledFailover(singleHandle, cur.createLightProxy(), str.id, _externalXid); } else { if (_externalXid == null) singleHandle.getParticipant().abort(cur.createLightProxy(), str.id); else ((IRemoteSpace) singleHandle.getParticipant()).abort(cur.createLightProxy(), _externalXid); } if (singleHandle.getAbortException() != null) throw singleHandle.getAbortException(); } else { throw new CannotAbortException("Transaction already COMMITTED"); } } catch (UnknownTransactionException e) { // TODO Auto-generated catch block throw new CannotAbortException(" reason=" + e); } catch (RemoteException e) { // TODO Auto-generated catch block throw new CannotAbortException(" reason=" + e); } }
public static Object abortPartitionWithEnabledFailover(ParticipantHandle handle, ExtendedTransactionManager mgr, long id, Object xid) { try { //create request for the designated partition AbortPreparedTransactionSpaceOperationRequest request = null; OperationID operationID = handle.getClusterProxy().createNewOperationID(); if (xid == null) { request = new AbortPreparedTransactionSpaceOperationRequest(mgr, id, handle.getPartionId(), operationID); } else { request = new AbortPreparedTransactionSpaceOperationRequest(mgr, xid, handle.getPartionId(), operationID); } // call execute on router giving the request handle.getClusterProxy().getProxyRouter().execute(request); request.getRemoteOperationResult().processExecutionException(); return new Integer(ABORTED); } catch (Exception ex) { CannotAbortException ex1 = new CannotAbortException(" abort failed reason=" + ex); handle.setAbortException(ex1); return new Integer(ABORTED); } }
else throw new CannotAbortException("Transaction already COMMITTED"); if (job != null) { if (job.isDirectCall()) throw new CannotAbortException("direct call on Transaction in progress"); job.stop(); throw new CannotAbortException("Transaction already COMMITTED"); le); throw new CannotAbortException("Unable to log");