Example #1
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public TransactionHandle terminate(long id) throws org.neo4j.server.rest.transactional.error.TransactionLifecycleException
        public override TransactionHandle Terminate(long id)
        {
            TransactionMarker marker = _registry[id];

            if (null == marker)
            {
                throw new InvalidTransactionId();
            }

            TransactionTerminationHandle handle = marker.ActiveTransaction.TerminationHandle;

            handle.Terminate();

            try
            {
                SuspendedTransaction transaction = marker.SuspendedTransaction;
                if (_registry.replace(id, marker, marker.ActiveTransaction))
                {
                    return(transaction.TransactionHandle);
                }
            }
            catch (InvalidConcurrentTransactionAccess)
            {
                // We could not acquire the transaction. Let the other request clean up.
            }
            return(null);
        }
Example #2
0
 internal ActiveTransaction(TransactionTerminationHandle terminationHandle)
 {
     this.TerminationHandleConflict = terminationHandle;
 }