} else { if (_xid == null) par.commit(tr.mgr, tr.id, preparedParticipants); else ((IRemoteSpace) par).commit(tr.mgr, _xid, preparedParticipants);
vote = par.prepareAndCommit(txnManager, tr.id); } else { IRemoteSpace rs = (IRemoteSpace) par;
/** * @param participant * @param extension * @throws LeaseDeniedException * @throws UnknownLeaseException */ private void renewParticipantLease(ParticipantHandle participant, long extension) { TransactionParticipant preParedParticipant = participant.getParticipant(); try { preParedParticipant.renewLease(str.mgr, str.id, extension); } catch (Exception e) { //ignore disconnected participants or invalid leases } }
} else { if (_xid == null) par.abort(tr.mgr, tr.id); else ((IRemoteSpace) par).abort(tr.mgr, _xid);
vote = par.prepare(tr.mgr, tr.id); else vote = ((IRemoteSpace) par).prepare(tr.mgr, _xid, participantsCount);
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); } }
if (_externalXid == null) res = singleHandle.getParticipant() .prepare(cur.createLightProxy(), str.id); else res = ((IRemoteSpace) (singleHandle.getParticipant())).prepare(cur.createLightProxy(),
private void lightCommit(ParticipantHandle singleHandle) throws CannotCommitException, TimeoutExpiredException, RemoteException { try { if (singleHandle.isSuitableForCommitFailover()) commitPartitionWithEnabledFailover(singleHandle); else { TxnMgrProxy cur = (TxnMgrProxy) str.mgr; if (_externalXid == null) singleHandle.getParticipant() .commit(cur.createLightProxy(), str.id); else ((IRemoteSpace) (singleHandle.getParticipant())).commit(cur.createLightProxy(), _externalXid); modifyTxnState(COMMITTED); } } catch (UnknownTransactionException e) { throw new CannotCommitException("[ID=" + str.id + "]: reason=" + e, e); } }
private void lightPrepareAndCommit(ParticipantHandle singleHandle) throws CannotCommitException, TimeoutExpiredException, RemoteException { try { if (modifyTxnState(VOTING)) { if (singleHandle.isSuitableForFailover()) { prepareAndCommitPartitionWithEnabledFailover(singleHandle); } else { TxnMgrProxy cur = (TxnMgrProxy) str.mgr; int res; if (_externalXid == null) res = singleHandle.getParticipant().prepareAndCommit(cur.createLightProxy(), str.id); else res = ((IRemoteSpace) (singleHandle.getParticipant())).prepareAndCommit(cur.createLightProxy(), _externalXid); if (res != COMMITTED) throw new CannotCommitException( "Unable to commit transaction: " + getParticipantInfo(), singleHandle.getCommitException()); modifyTxnState(res); } } else { if (getState() == COMMITTED) return; throw new CannotCommitException(); } } catch (UnknownTransactionException e) { throw new CannotCommitException(" reason=" + e, e); } }