コード例 #1
0
        public ProcedureCacheEntry GetProcedure(MyCatConnection conn, string spName, string cacheKey)
        {
            ProcedureCacheEntry proc = null;

            if (cacheKey != null)
            {
                int hash = cacheKey.GetHashCode();

                lock (procHash)
                {
                    procHash.TryGetValue(hash, out proc);
                }
            }
            if (proc == null)
            {
                proc = AddNew(conn, spName);
                conn.PerfMonitor.AddHardProcedureQuery();
                if (conn.Settings.Logging)
                {
                    MyCatTrace.LogInformation(conn.ServerThread,
                                              String.Format(Resources.HardProcQuery, spName));
                }
            }
            else
            {
                conn.PerfMonitor.AddSoftProcedureQuery();
                if (conn.Settings.Logging)
                {
                    MyCatTrace.LogInformation(conn.ServerThread,
                                              String.Format(Resources.SoftProcQuery, spName));
                }
            }
            return(proc);
        }