protected DbSession(IDbDatabase database) { _database = database as DbDatabase; if (_database == null) { throw new XException($"A classe {GetType().Name} não tem suporte a Database do tipo {database.GetType().Name}"); } _accessInTransaction = new Dictionary <IDbAccess, DbContext>(); }
public bool Storage(IDbDatabase database) { if (Constains(database.Name)) { return(false); } _dbs.Add(database.Name, database); return(true); }
public static bool RetryInteraction(IDbDatabase database, SqlException exception) { switch (exception.Number) { case TimeoutErrorCode: case -2: return((database.Options & EDatabaseOption.RetryTimeout) == EDatabaseOption.RetryTimeout); case DeadlockErrorCode: return((database.Options & EDatabaseOption.RetryDeadlock) == EDatabaseOption.RetryDeadlock); case TransportLevelErrorCode when exception.Class == TransportLevelSeverityClass: SqlConnection.ClearAllPools(); return(true); default: return(false); } }
public SqlServerSession(IDbDatabase dbServerDatabase) : base(dbServerDatabase) { }