Esempio n. 1
0
 public void Dispose()
 {
     DisposeHelper.EnsureAllSteps(
         () => this.EndTransaction(), //Transaction が生き残っていたら終わらせる
         () =>
     {
         //Connection を Pool に返す
         if (this._connection != null)
         {
             this._pool.ReleaseConnection(this._connection.IndexInPool, this._connection.PayOutNumber);
         }
     },
         () => this._connection = null,  //借りてたものをもう使わないという意思表示
         () => this._pool       = null); //Pool はお外で管理されてるからここでは参照切るだけ
 }
Esempio n. 2
0
 public void Dispose()
 {
     DisposeHelper.EnsureAllSteps(
         () =>
     {
         //実行中のものがあれば全て解放する
         var workingCommands = this._workingCommands.Keys.ToArray();
         foreach (var workingCommand in workingCommands)
         {
             workingCommand.Dispose();
         }
     },
         () => this._workingCommands.Clear(),
         () => this._pool = null); //Pool はお外で管理されてるからここでは参照切るだけ
 }
Esempio n. 3
0
 public GlobalConnectionPoolTransactionStrategy([NotNull] GlobalConnectionPool pool)
 {
     this._pool = pool;
 }
 public GlobalConnectionPoolStrategyFactory(GlobalConnectionPool pool)
 {
     this._pool = pool;
 }