@Override public void afterCompletion(int status) { try { if (txRolledback) { return; } TXCommitMessage txcm = this.firstProxy.afterCompletion(status, proxy.getTxId().getUniqId()); if (status == Status.STATUS_COMMITTED) { if (txcm == null) { throw new TransactionInDoubtException( "Commit failed on cache server"); } else { afterServerCommit(txcm); } } else if (status == Status.STATUS_ROLLEDBACK) { if (this.internalAfterSendRollback != null) { this.internalAfterSendRollback.run(); } this.firstProxy.getPool().releaseServerAffinity(); } } finally { if (status == Status.STATUS_COMMITTED) { // rollback does not grab locks this.lockReq.releaseLocal(); } this.firstProxy.getPool().releaseServerAffinity(); } }