internal static OracleConnectionHolder GetConnection(
            string connectionString)
        {
            OracleConnectionHolder connectionHolder = new OracleConnectionHolder(connectionString);
            bool flag = true;

            try
            {
                try
                {
                    connectionHolder.Open((HttpContext)null, true);
                    flag = false;
                }
                finally
                {
                    if (flag)
                    {
                        connectionHolder.Close();
                        connectionHolder = (OracleConnectionHolder)null;
                    }
                }
            }
            catch
            {
                throw;
            }
            return(connectionHolder);
        }
示例#2
0
 internal static void CleanUpConnectionResources(
     ref OracleCommand cmd,
     ref OracleConnectionHolder holder)
 {
     if (cmd != null)
     {
         foreach (OracleParameter parameter in (DbParameterCollection)cmd.Parameters)
         {
             parameter?.Dispose();
         }
         ((Component)cmd).Dispose();
         cmd = (OracleCommand)null;
     }
     if (holder == null)
     {
         return;
     }
     holder.Close();
     holder = (OracleConnectionHolder)null;
 }