public override async Task <IStatementResultCursor> RunInAutoCommitTransactionAsync(IConnection connection,
                                                                                            Statement statement, bool reactive, IBookmarkTracker bookmarkTracker,
                                                                                            IResultResourceHandler resultResourceHandler,
                                                                                            string database, Bookmark bookmark, TransactionConfig configBuilder, long fetchSize = Config.Infinite)
        {
            var summaryBuilder = new SummaryBuilder(statement, connection.Server);
            var streamBuilder  = new StatementResultCursorBuilder(summaryBuilder, connection.ReceiveOneAsync,
                                                                  RequestMore(connection, summaryBuilder, bookmarkTracker),
                                                                  CancelRequest(connection, summaryBuilder, bookmarkTracker),
                                                                  resultResourceHandler,
                                                                  fetchSize, reactive);
            var runHandler = new V4.RunResponseHandler(streamBuilder, summaryBuilder);

            var pullMessage = default(PullMessage);
            var pullHandler = default(V4.PullResponseHandler);

            if (!reactive)
            {
                pullMessage = new PullMessage(fetchSize);
                pullHandler = new V4.PullResponseHandler(streamBuilder, summaryBuilder, bookmarkTracker);
            }

            await connection
            .EnqueueAsync(
                new RunWithMetadataMessage(statement, database, bookmark, configBuilder,
                                           connection.GetEnforcedAccessMode()), runHandler,
                pullMessage, pullHandler)
            .ConfigureAwait(false);

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

            return(streamBuilder.CreateCursor());
        }
        public override async Task <IStatementResultCursor> RunInExplicitTransactionAsync(IConnection connection,
                                                                                          Statement statement, bool reactive, long fetchSize = Config.Infinite)
        {
            var summaryBuilder = new SummaryBuilder(statement, connection.Server);
            var streamBuilder  = new StatementResultCursorBuilder(summaryBuilder, connection.ReceiveOneAsync,
                                                                  RequestMore(connection, summaryBuilder, null),
                                                                  CancelRequest(connection, summaryBuilder, null), null,
                                                                  fetchSize, reactive);
            var runHandler = new V4.RunResponseHandler(streamBuilder, summaryBuilder);

            var pullMessage = default(PullMessage);
            var pullHandler = default(V4.PullResponseHandler);

            if (!reactive)
            {
                pullMessage = new PullMessage(fetchSize);
                pullHandler = new V4.PullResponseHandler(streamBuilder, summaryBuilder, null);
            }

            await connection.EnqueueAsync(new RunWithMetadataMessage(statement),
                                          runHandler, pullMessage, pullHandler)
            .ConfigureAwait(false);

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

            return(streamBuilder.CreateCursor());
        }