Exemple #1
0
        public virtual async Task <IResultCursor> RunInExplicitTransactionAsync(IConnection connection, Query query, bool reactive, long fetchSize = Config.Infinite)
        {
            var summaryBuilder = new SummaryBuilder(query, connection.Server);
            var streamBuilder  = new ResultCursorBuilder(summaryBuilder, connection.ReceiveOneAsync, null, null, null);
            var runHandler     = new V3.RunResponseHandler(streamBuilder, summaryBuilder);
            var pullAllHandler = new V3.PullResponseHandler(streamBuilder, summaryBuilder, null);
            await connection.EnqueueAsync(new RunWithMetadataMessage(query), runHandler, PullAll, pullAllHandler).ConfigureAwait(false);

            await connection.SendAsync().ConfigureAwait(false);

            return(streamBuilder.CreateCursor());
        }
Exemple #2
0
        public virtual async Task <IStatementResultCursor> RunInExplicitTransactionAsync(IConnection connection,
                                                                                         Statement statement, bool reactive)
        {
            var summaryBuilder = new SummaryBuilder(statement, connection.Server);
            var streamBuilder  = new StatementResultCursorBuilder(summaryBuilder, connection.ReceiveOneAsync, null, null, null);
            var runHandler     = new V3.RunResponseHandler(streamBuilder, summaryBuilder);
            var pullAllHandler = new V3.PullResponseHandler(streamBuilder, summaryBuilder, null);
            await connection.EnqueueAsync(new RunWithMetadataMessage(statement, connection.GetEnforcedAccessMode()),
                                          runHandler, PullAll, pullAllHandler)
            .ConfigureAwait(false);

            await connection.SendAsync().ConfigureAwait(false);

            return(streamBuilder.CreateCursor());
        }
Exemple #3
0
        public virtual async Task <IResultCursor> RunInAutoCommitTransactionAsync(IConnection connection,
                                                                                  Query query,
                                                                                  bool reactive,
                                                                                  IBookmarkTracker bookmarkTracker,
                                                                                  IResultResourceHandler resultResourceHandler,
                                                                                  string database,
                                                                                  Bookmark bookmark,
                                                                                  TransactionConfig config,
                                                                                  long fetchSize = Config.Infinite)
        {
            AssertNullDatabase(database);

            var summaryBuilder = new SummaryBuilder(query, connection.Server);
            var streamBuilder  = new ResultCursorBuilder(summaryBuilder, connection.ReceiveOneAsync, null, null, resultResourceHandler);
            var runHandler     = new V3.RunResponseHandler(streamBuilder, summaryBuilder);
            var pullAllHandler = new V3.PullResponseHandler(streamBuilder, summaryBuilder, bookmarkTracker);
            await connection.EnqueueAsync(new RunWithMetadataMessage(query, bookmark, config, connection.GetEnforcedAccessMode()), runHandler, PullAll, pullAllHandler).ConfigureAwait(false);

            await connection.SendAsync().ConfigureAwait(false);

            return(streamBuilder.CreateCursor());
        }