void endTransaction ( Session session ) { try { writeLock . lock ( ) ; long timestamp = session . transactionTimestamp ; synchronized ( liveTransactionTimestamps ) { session . isTransaction = false ; int index = liveTransactionTimestamps . indexOf ( timestamp ) ; liveTransactionTimestamps . remove ( index ) ; } mergeExpiredTransactions ( session ) ; } finally { writeLock . unlock ( ) ; } }
remove session from queue when a transaction ends and expire any committed transactions that are no longer required . remove transactions ended before the first timestamp in liveTransactionsSession queue