public Transaction(IDBTraits traits, string connectionString) { this.traits = traits; DbConnection _connection = null; DbTransaction _transaction = null; try { _connection = traits.CreateConnection(connectionString); _transaction = _connection.BeginTransaction(IsolationLevel.Serializable); this.connection = _connection; this.transaction = _transaction; } catch(Exception) { if(_transaction != null) { _transaction.Dispose(); this.transaction = null; } if(_connection != null) { _connection.Dispose(); this.connection = null; } throw; } }
public Transaction(IDBTraits traits, string connectionString) { this.traits = traits; DbConnection _connection = null; DbTransaction _transaction = null; try { _connection = traits.CreateConnection(connectionString); _transaction = _connection.BeginTransaction(IsolationLevel.Serializable); this.connection = _connection; this.transaction = _transaction; } catch (Exception) { if (_transaction != null) { _transaction.Dispose(); this.transaction = null; } if (_connection != null) { _connection.Dispose(); this.connection = null; } throw; } }
public Connection(string connectionString, IDBTraits traits, ILogger logger) { this.traits = traits; this.logger = logger; this.connectionString = connectionString; using(DbConnection connection = this.createConnection()) { //just testing we can open a connection } this.transactions = new HashSet<Transaction>(); }
public Connection(string connectionString, IDBTraits traits, ILogger logger) { this.traits = traits; this.logger = logger; this.connectionString = connectionString; using (DbConnection connection = this.createConnection()) { //just testing we can open a connection } this.transactions = new HashSet <Transaction>(); }
public static KeyValuePair<string, ParamsHolder> Compile(AbstractCondition condition, IDBTraits traits) { ConditionCompiler compiler = new ConditionCompiler(traits); string compiled = compiler.CompileCondition(condition); return new KeyValuePair<string,ParamsHolder>(compiled, compiler.paramsholder); }
private ConditionCompiler(IDBTraits traits) { this.paramsholder = new ParamsHolder(); this.traits = traits; }
public static KeyValuePair <string, ParamsHolder> Compile(AbstractCondition condition, IDBTraits traits) { ConditionCompiler compiler = new ConditionCompiler(traits); string compiled = compiler.CompileCondition(condition); return(new KeyValuePair <string, ParamsHolder>(compiled, compiler.paramsholder)); }
public static string compile(this ITableSpec table, IDBTraits traits) { return(traits.escapeIdentifier(table.name)); }
public static string compile(this ColumnSpec column, IDBTraits traits) { return(column.table.compile(traits) + "." + traits.escapeIdentifier(column.name)); }
public static string compile(this ColumnSpec column, IDBTraits traits) { return column.table.compile(traits) + "." + traits.escapeIdentifier(column.name); }
public static string compile(this ITableSpec table, IDBTraits traits) { return traits.escapeIdentifier(table.name); }
public Context(IUpdateParams updateParams, IInteractiveConsole console) { this.updateParams = updateParams; this.DbDriver = DBTraitsFactory.GetTraits(updateParams.DbDriverName); this.console = console; }