protected static ChangeRecordsSessionCache RetrieveCacheFromDB(string key) { Debug.Enter(); // // Retrieve the cache object from the database. // string data = ""; SqlStoredProcedureAccessor sp = new SqlStoredProcedureAccessor("UI_getSessionCache"); sp.Parameters.Add("@PUID", SqlDbType.NVarChar); sp.Parameters.Add("@context", SqlDbType.NVarChar); sp.Parameters.SetString("@PUID", key); sp.Parameters.SetString("@context", "ReplicationServer"); data = (string)sp.ExecuteScalar(); // // Deserialize into a cache object. // ChangeRecordsSessionCache cache = null; if (!Utility.StringEmpty(data)) { XmlSerializer serializer = new XmlSerializer(typeof(ChangeRecordsSessionCache)); StringReader reader = new StringReader(data); cache = (ChangeRecordsSessionCache)serializer.Deserialize(reader); cache.Key = key; } Debug.Leave(); return(cache); }
public static ChangeRecordsSessionCache RetrieveCache(string key) { ChangeRecordsSessionCache session = RetrieveCacheFromDB(key); return(session); }