コード例 #1
0
        public async Task <IStatementResultCursor> RunInExplicitTransactionAsync(IConnection connection, Statement statement)
        {
            var resultBuilder = new ResultCursorBuilder(
                NewSummaryCollector(statement, connection.Server), connection.ReceiveOneAsync);

            connection.Enqueue(new RunWithMetadataMessage(statement), resultBuilder, PullAll);
            await connection.SendAsync().ConfigureAwait(false);

            return(await resultBuilder.PreBuildAsync().ConfigureAwait(false));
        }
コード例 #2
0
        public async Task <IStatementResultCursor> RunInAutoCommitTransactionAsync(IConnection connection, Statement statement,
                                                                                   IResultResourceHandler resultResourceHandler, Bookmark bookmark, TransactionConfig txConfig)
        {
            var resultBuilder = new ResultCursorBuilder(NewSummaryCollector(statement, connection.Server),
                                                        connection.ReceiveOneAsync, resultResourceHandler);

            connection.Enqueue(new RunWithMetadataMessage(statement, bookmark, txConfig), resultBuilder, PullAll);
            await connection.SendAsync().ConfigureAwait(false);

            return(await resultBuilder.PreBuildAsync().ConfigureAwait(false));
        }
コード例 #3
0
        public async Task <IStatementResultCursor> RunInExplicitTransactionAsync(IConnection connection,
                                                                                 Statement statement)
        {
            var resultBuilder = new ResultCursorBuilder(statement.Text, statement.Parameters, connection.ReceiveOneAsync,
                                                        connection.Server);

            connection.Enqueue(new RunMessage(statement), resultBuilder, PullAll);
            await connection.SendAsync().ConfigureAwait(false);

            return(await resultBuilder.PreBuildAsync().ConfigureAwait(false));
        }
コード例 #4
0
        public override Task <IStatementResultCursor> RunAsync(Statement statement)
        {
            return(TryExecuteAsync(async() =>
            {
                EnsureNotFailed();

                var resultBuilder = new ResultCursorBuilder(statement.Text, statement.Parameters, () => _connection.ReceiveOneAsync(),
                                                            _connection.Server);
                _connection.Run(statement.Text, statement.Parameters, resultBuilder);
                await _connection.SendAsync().ConfigureAwait(false);

                return await resultBuilder.PreBuildAsync().ConfigureAwait(false);
            }));
        }
コード例 #5
0
        public override Task <IStatementResultCursor> RunAsync(Statement statement)
        {
            return(TryExecuteAsync(async() =>
            {
                await EnsureCanRunMoreStatementsAsync().ConfigureAwait(false);

                _connection = await _connectionProvider.AcquireAsync(_defaultMode).ConfigureAwait(false);
                var resultBuilder = new ResultCursorBuilder(statement.Text, statement.Parameters,
                                                            () => _connection.ReceiveOneAsync(), _connection.Server, this);
                _connection.Run(statement.Text, statement.Parameters, resultBuilder);

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

                return await resultBuilder.PreBuildAsync().ConfigureAwait(false);
            }));
        }