Пример #1
0
        public void ReturnObject(IDatabase db, IDbConnection conn)
        {
            GenericObjectPool <IDbConnection> pool = GetOrCreatePool(db);

            pool.ReturnObject(conn);

            if (db != null && db.Config.EnableLogConnectionPool == true)
            {
                db.LogHelper.Debug("-------------------ReturnObject IDbConnection:" + conn.GetHashCode() + "; status:" + conn.State);
                db.LogHelper.Debug("CreatedCount:" + pool.CreatedCount + "; ActiveCount:" + pool.ActiveCount + "; BorrowedCount:" + pool.BorrowedCount
                                   + "; ReturnedCount:" + pool.ReturnedCount
                                   + "; MaxTotal:" + pool.MaxTotal
                                   + "; IdleCount:" + pool.IdleCount
                                   + "; NumIdle:" + pool.NumIdle
                                   + "; ActiveCount:" + pool.ActiveCount
                                   + "; NumActive:" + pool.NumActive
                                   + "; NumTests:" + pool.NumTests
                                   + "; DestroyedCount:" + pool.DestroyedCount
                                   + "; DestroyedByBorrowValidationCount:" + pool.DestroyedByBorrowValidationCount
                                   );
            }
        }