Пример #1
0
        public override void Close()
        {
            try
            {
                if (_transaction.Open)
                {
                    _transaction.close();
                }
            }
            catch (TransientFailureException e)
            {
                // We let transient exceptions pass through unchanged since they aren't really transaction failures
                // in the same sense as unexpected failures are. Such exception signals that the transaction
                // can be retried and might be successful the next time.
                throw e;
            }
            catch (ConstraintViolationTransactionFailureException e)
            {
                throw new ConstraintViolationException(e.Message, e);
            }
            catch (Exception e) when(e is KernelException || e is TransactionTerminatedException)
            {
                Status_Code statusCode = e.status().code();

                if (statusCode.Classification() == Status_Classification.TransientError)
                {
                    throw new TransientTransactionFailureException(CloseFailureMessage() + ": " + statusCode.Description(), e);
                }
                throw new TransactionFailureException(CloseFailureMessage(), e);
            }
            catch (Exception e)
            {
                throw new TransactionFailureException(CloseFailureMessage(), e);
            }
        }
Пример #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: public void close() throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
            public override void Close()
            {
                Internal.close();
            }