Ejemplo n.º 1
0
        public void ClearPool(DbConnection connection)
        {
            ADP.CheckArgumentNull(connection, "connection");

            IntPtr hscp;

            Bid.ScopeEnter(out hscp, "<prov.DbConnectionFactory.ClearPool|API> %d#", GetObjectId(connection));
            try {
                DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup(connection);
                if (null != poolGroup)
                {
                    poolGroup.Clear();
                }
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }
Ejemplo n.º 2
0
        public void ClearPool(DbConnection connection)
        {
            ADP.CheckArgumentNull(connection, nameof(connection));
            long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearPool|API> {0}", GetObjectId(connection));

            try
            {
                DbConnectionPoolGroup poolGroup = GetConnectionPoolGroup(connection);
                if (null != poolGroup)
                {
                    poolGroup.Clear();
                }
            }
            finally
            {
                SqlClientEventSource.Log.ScopeLeaveEvent(scopeID);
            }
        }
Ejemplo n.º 3
0
        public void ClearAllPools()
        {
            IntPtr hscp;

            Bid.ScopeEnter(out hscp, "<prov.DbConnectionFactory.ClearAllPools|API> ");
            try {
                Dictionary <DbConnectionPoolKey, DbConnectionPoolGroup> connectionPoolGroups = _connectionPoolGroups;
                foreach (KeyValuePair <DbConnectionPoolKey, DbConnectionPoolGroup> entry in connectionPoolGroups)
                {
                    DbConnectionPoolGroup poolGroup = entry.Value;
                    if (null != poolGroup)
                    {
                        poolGroup.Clear();
                    }
                }
            }
            finally {
                Bid.ScopeLeave(ref hscp);
            }
        }
Ejemplo n.º 4
0
        public void ClearAllPools()
        {
            long scopeID = SqlClientEventSource.Log.ScopeEnterEvent("<prov.DbConnectionFactory.ClearAllPools|{0}>", "API");

            try
            {
                Dictionary <DbConnectionPoolKey, DbConnectionPoolGroup> connectionPoolGroups = _connectionPoolGroups;
                foreach (KeyValuePair <DbConnectionPoolKey, DbConnectionPoolGroup> entry in connectionPoolGroups)
                {
                    DbConnectionPoolGroup poolGroup = entry.Value;
                    if (null != poolGroup)
                    {
                        poolGroup.Clear();
                    }
                }
            }
            finally
            {
                SqlClientEventSource.Log.ScopeLeaveEvent(scopeID);
            }
        }