Beispiel #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 RunResponseHandler(streamBuilder, summaryBuilder);
            var pullAllHandler = new PullResponseHandler(streamBuilder, summaryBuilder, null);
            await connection.EnqueueAsync(GetRunWithMetaDataMessage(query), runHandler, PullAll, pullAllHandler).ConfigureAwait(false);

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

            return(streamBuilder.CreateCursor());
        }
Beispiel #2
0
        public virtual async Task <IResultCursor> RunInAutoCommitTransactionAsync(IConnection connection,
                                                                                  Query query,
                                                                                  bool reactive,
                                                                                  IBookmarkTracker bookmarkTracker,
                                                                                  IResultResourceHandler resultResourceHandler,
                                                                                  string database,
                                                                                  Bookmark bookmark,
                                                                                  TransactionConfig config,
                                                                                  string impersonatedUser,
                                                                                  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 RunResponseHandler(streamBuilder, summaryBuilder);
            var pullAllHandler = new PullResponseHandler(streamBuilder, summaryBuilder, bookmarkTracker);
            await connection.EnqueueAsync(GetRunWithMetaDataMessage(query, bookmark, config, connection.GetEnforcedAccessMode(), null, impersonatedUser), runHandler, PullAll, pullAllHandler).ConfigureAwait(false);

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

            return(streamBuilder.CreateCursor());
        }