@Override protected ActiveTransactionsRecord getSameRecordForNewTransaction() { this.activeTxRecord.incrementRunning(); return this.activeTxRecord; }
public ClusteredPersistentTransaction(ActiveTransactionsRecord record) { super(record); ActiveTransactionsRecord newRecord = tryToApplyRemoteCommits(record); if (newRecord != this.activeTxRecord) { // if a new record is returned, that means that this transaction // will belong // to that new record, so we must take it off from its current // record and set // it properly newRecord.incrementRunning(); this.activeTxRecord.decrementRunning(); this.activeTxRecord = newRecord; setNumber(newRecord.transactionNumber); } }
@Override protected boolean validateCommit() { ActiveTransactionsRecord mostRecentRecord = Transaction.mostRecentRecord; boolean result = super.validateCommit(); if (result) { // upgradeTx(); setNumber(mostRecentRecord.transactionNumber); // the correct order is to increment first the // new, and only then decrement the old mostRecentRecord.incrementRunning(); this.activeTxRecord.decrementRunning(); this.activeTxRecord = mostRecentRecord; } else { TransactionSupport.STATISTICS.incConflicts(); } return result; }
@Override protected boolean validateCommit() { ActiveTransactionsRecord mostRecentRecord = Transaction.mostRecentRecord; boolean result = super.validateCommit(); if (result) { // upgradeTx(); setNumber(mostRecentRecord.transactionNumber); // the correct order is to increment first the // new, and only then decrement the old mostRecentRecord.incrementRunning(); this.activeTxRecord.decrementRunning(); this.activeTxRecord = mostRecentRecord; } else { TransactionStatistics.STATISTICS.incConflicts(); } return result; }
newRecord.incrementRunning(); this.activeTxRecord.decrementRunning(); this.activeTxRecord = newRecord;