public DelimitedDbStatement( ISqlDialect dialect, TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) : base(dialect, scope, connection, transaction) {}
public DelimitedDbStatement( ISqlDialect dialect, TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) : base(dialect, scope, connection, transaction) { }
protected virtual IAsyncEnumerable <T> ExecuteQuery2 <T>(Func <IDbStatement, Task <IAsyncEnumerable <T> > > query) { return(AsyncEnumerable.Create <T>(async producer => { ThrowWhenDisposed(); TransactionScope scope = OpenQueryScope(); IDbAsyncConnection connection = null; IDbTransaction transaction = null; IDbStatement statement = null; try { connection = await _connectionFactory.OpenAsync(); transaction = _dialect.OpenTransaction(connection); statement = _dialect.BuildStatement(scope, connection, transaction); statement.PageSize = _pageSize; Logger.Verbose(Messages.ExecutingQuery); await producer.Yield(await query(statement)); Logger.Verbose(Messages.ExecutingQuery); } catch (Exception e) { if (statement != null) { statement.Dispose(); } if (transaction != null) { transaction.Dispose(); } if (connection != null) { connection.Dispose(); } if (scope != null) { scope.Dispose(); } Logger.Debug(Messages.StorageThrewException, e.GetType()); if (e is StorageUnavailableException) { throw; } throw new StorageException(e.Message, e); } })); }
public CommonDbStatement( ISqlDialect dialect, TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { Parameters = new Dictionary<string, Tuple<object, DbType?>>(); _dialect = dialect; _scope = scope; _connection = connection; _transaction = transaction; }
public CommonDbStatement( ISqlDialect dialect, TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { Parameters = new Dictionary <string, Tuple <object, DbType?> >(); _dialect = dialect; _scope = scope; _connection = connection; _transaction = transaction; }
public OracleDbStatement(ISqlDialect dialect, TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) : base(dialect, scope, connection, transaction) { _dialect = dialect; }
public virtual IDbStatement BuildStatement( TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { return(new CommonDbStatement(this, scope, connection, transaction)); }
public virtual void AddPayloadParamater(IConnectionFactory connectionFactory, IDbAsyncConnection connection, IDbStatement cmd, byte[] payload) { cmd.AddParameter(Payload, payload); }
public override void AddPayloadParamater(IConnectionFactory connectionFactory, IDbAsyncConnection connection, IDbStatement cmd, byte[] payload) { if (_addPayloadParamater == null) { string dbProviderAssemblyName = connectionFactory.GetDbProviderFactoryType().Assembly.GetName().Name; const string oracleManagedDataAcccessAssemblyName = "Oracle.ManagedDataAccess"; const string oracleDataAcccessAssemblyName = "Oracle.DataAccess"; if (dbProviderAssemblyName.Equals(oracleManagedDataAcccessAssemblyName, StringComparison.Ordinal)) { _addPayloadParamater = CreateOraAddPayloadAction(oracleManagedDataAcccessAssemblyName); } else if (dbProviderAssemblyName.Equals(oracleDataAcccessAssemblyName, StringComparison.Ordinal)) { _addPayloadParamater = CreateOraAddPayloadAction(oracleDataAcccessAssemblyName); } else { _addPayloadParamater = (connectionFactory2, connection2, cmd2, payload2) => base.AddPayloadParamater(connectionFactory2, connection2, cmd2, payload2); } } _addPayloadParamater(connectionFactory, connection, cmd, payload); }
public override IDbStatement BuildStatement(TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { return(new OracleDbStatement(this, scope, connection, transaction)); }
public virtual IDbStatement BuildStatement( TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { return new CommonDbStatement(this, scope, connection, transaction); }
public override IDbStatement BuildStatement(TransactionScope scope, IDbAsyncConnection connection, IDbTransaction transaction) { return new OracleDbStatement(this, scope, connection, transaction); }