public override bool OnSqlErrorRetry(SdbConnection conn, DbException ex, int attempt)
        {
            Debug.Print($"Initialize {Name} error: {ex}, retrying {attempt}");

            conn.Close();
            return(true);
        }
Exemple #2
0
 /// <summary>
 /// This is direct approach, without Producer/Consumer pattern
 /// </summary>
 /// <param name="dbConn"></param>
 /// <returns></returns>
 public static SdbResult RunWith(this SdbRequest SdbRequest, SdbConnection dbConn)
 {
     return(SdbRequestRunner.ExecuteDbRequest(dbConn.Connection, SdbRequest, dbConn.dbConfig));
 }
Exemple #3
0
 /// <summary>
 /// Called after each retry when opening connection, must return true to continue retrying.
 /// >> Should this method be virtual?
 /// </summary>
 /// <param name="ex"></param>
 /// <param name="attempt"></param>
 /// <returns></returns>
 public abstract bool OnSqlErrorRetry(SdbConnection conn, DbException ex, int attempt);
Exemple #4
0
 public SdbQueue(SdbConnection conn, int queueSize = 400)
 {
     // roCommandsQueue = rwCommandsQueue;
     this.rwCommandsQueue = new BlockingCollection <SdbRequest>(queueSize);
     this.conn            = conn;
 }