Beispiel #1
0
            /*
             * This is overly careful about always closing and nulling the transaction since
             * reset can cause ctx.currentTransaction to be null we store in local variable.
             */
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void closeTransaction(MutableTransactionState ctx, boolean success) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
            internal void CloseTransaction(MutableTransactionState ctx, bool success)
            {
                KernelTransaction tx = ctx.CurrentTransaction;

                ctx.CurrentTransaction = null;
                if (tx != null)
                {
                    try
                    {
                        if (success)
                        {
                            tx.Success();
                        }
                        else
                        {
                            tx.Failure();
                        }
                        if (tx.Open)
                        {
                            tx.Close();
                        }
                    }
                    finally
                    {
                        ctx.CurrentTransaction = null;
                    }
                }
            }
Beispiel #2
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void startExecution(MutableTransactionState ctx, org.neo4j.bolt.runtime.BoltResultHandle resultHandle) throws org.neo4j.internal.kernel.api.exceptions.KernelException
            internal void StartExecution(MutableTransactionState ctx, Org.Neo4j.Bolt.runtime.BoltResultHandle resultHandle)
            {
                ctx.CurrentResultHandle = resultHandle;
                try
                {
                    ctx.CurrentResult = resultHandle.Start();
                }
                catch (Exception t)
                {
                    ctx.CurrentResultHandle.close(false);
                    ctx.CurrentResultHandle = null;
                    throw t;
                }
            }
Beispiel #3
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: void terminateQueryAndRollbackTransaction(MutableTransactionState ctx) throws org.neo4j.internal.kernel.api.exceptions.TransactionFailureException
            internal void TerminateQueryAndRollbackTransaction(MutableTransactionState ctx)
            {
                if (ctx.CurrentResultHandle != null)
                {
                    ctx.CurrentResultHandle.terminate();
                    ctx.CurrentResultHandle = null;
                }
                if (ctx.CurrentResult != null)
                {
                    ctx.CurrentResult.close();
                    ctx.CurrentResult = null;
                }

                CloseTransaction(ctx, false);
            }
Beispiel #4
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: boolean consumeResult(MutableTransactionState ctx, org.neo4j.function.ThrowingConsumer<org.neo4j.bolt.runtime.BoltResult,Exception> resultConsumer) throws Exception
            internal bool ConsumeResult(MutableTransactionState ctx, Org.Neo4j.Function.ThrowingConsumer <Org.Neo4j.Bolt.runtime.BoltResult, Exception> resultConsumer)
            {
                bool success = false;

                try
                {
                    resultConsumer.Accept(ctx.CurrentResult);
                    success = true;
                }
                finally
                {
                    ctx.CurrentResult.close();
                    ctx.CurrentResult = null;

                    if (ctx.CurrentResultHandle != null)
                    {
                        ctx.CurrentResultHandle.close(success);
                        ctx.CurrentResultHandle = null;
                    }
                }
                return(success);
            }
Beispiel #5
0
 internal TransactionStateMachine(TransactionStateMachineSPI spi, AuthenticationResult authenticationResult, Clock clock)
 {
     this.Spi = spi;
     Ctx      = new MutableTransactionState(authenticationResult, clock);
 }
Beispiel #6
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: abstract State rollbackTransaction(MutableTransactionState ctx, org.neo4j.bolt.runtime.TransactionStateMachineSPI spi) throws org.neo4j.internal.kernel.api.exceptions.KernelException;
            internal abstract State rollbackTransaction(MutableTransactionState ctx, Org.Neo4j.Bolt.runtime.TransactionStateMachineSPI spi);
Beispiel #7
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: abstract org.neo4j.bolt.v1.runtime.bookmarking.Bookmark streamResult(MutableTransactionState ctx, org.neo4j.bolt.runtime.TransactionStateMachineSPI spi, org.neo4j.function.ThrowingConsumer<org.neo4j.bolt.runtime.BoltResult,Exception> resultConsumer) throws Exception;
            internal abstract Org.Neo4j.Bolt.v1.runtime.bookmarking.Bookmark streamResult(MutableTransactionState ctx, Org.Neo4j.Bolt.runtime.TransactionStateMachineSPI spi, Org.Neo4j.Function.ThrowingConsumer <Org.Neo4j.Bolt.runtime.BoltResult, Exception> resultConsumer);
Beispiel #8
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: abstract State run(MutableTransactionState ctx, org.neo4j.bolt.runtime.TransactionStateMachineSPI spi, String statement, org.neo4j.values.virtual.MapValue params, org.neo4j.bolt.v1.runtime.bookmarking.Bookmark bookmark, java.time.Duration txTimeout, java.util.Map<String,Object> txMetadata) throws org.neo4j.internal.kernel.api.exceptions.KernelException;
            internal abstract State run(MutableTransactionState ctx, Org.Neo4j.Bolt.runtime.TransactionStateMachineSPI spi, string statement, [email protected] @params, Org.Neo4j.Bolt.v1.runtime.bookmarking.Bookmark bookmark, java.time.Duration txTimeout, IDictionary <string, object> txMetadata);
Beispiel #9
0
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in C#:
//ORIGINAL LINE: abstract State beginTransaction(MutableTransactionState ctx, org.neo4j.bolt.runtime.TransactionStateMachineSPI spi, org.neo4j.bolt.v1.runtime.bookmarking.Bookmark bookmark, java.time.Duration txTimeout, java.util.Map<String,Object> txMetadata) throws org.neo4j.internal.kernel.api.exceptions.KernelException;
            internal abstract State beginTransaction(MutableTransactionState ctx, Org.Neo4j.Bolt.runtime.TransactionStateMachineSPI spi, Org.Neo4j.Bolt.v1.runtime.bookmarking.Bookmark bookmark, java.time.Duration txTimeout, IDictionary <string, object> txMetadata);