internal TdsParserSessionPool(TdsParser parser) { this._parser = parser; this._cache = new List<TdsParserStateObject>(); this._freeStack = new TdsParserStateObjectListStack(); if (Bid.AdvancedOn) { Bid.Trace("<sc.TdsParserSessionPool.ctor|ADV> %d# created session pool for parser %d\n", this.ObjectID, parser.ObjectID); } }
internal TdsParserSessionPool(TdsParser parser) { this._parser = parser; this._cache = new List <TdsParserStateObject>(); this._freeStack = new TdsParserStateObjectListStack(); if (Bid.AdvancedOn) { Bid.Trace("<sc.TdsParserSessionPool.ctor|ADV> %d# created session pool for parser %d\n", this.ObjectID, parser.ObjectID); } }
internal void Dispose() { if (Bid.AdvancedOn) { Bid.Trace("<sc.TdsParserSessionPool.Dispose|ADV> %d# disposing cachedCount=%d\n", this.ObjectID, this._cachedCount); } this._freeStack = null; lock (this._cache) { for (int i = 0; i < this._cache.Count; i++) { TdsParserStateObject obj2 = this._cache[i]; if (obj2 != null) { obj2.Dispose(); } } this._cache.Clear(); } }