//向DB中写入一条数据
 internal static int SingleSaveItem(int msgId, InnerCacheItem cacheItem, int dataVersion)
 {
     if (DataCacheConfig.IsPersistent)
     {
         try {
             DataDML.Save(msgId, cacheItem.Valid, dataVersion, cacheItem.DataMessage);
         } catch (Exception ex) {
             DBConn.Close();
             LogSys.Log(LOG_TYPE.ERROR, "SingleSaveItem ERROR. MsgId:{0}, Error:{1}\nStacktrace:{2}", msgId, ex.Message, ex.StackTrace);
             throw ex;
         }
     }
     return(1);
 }
 //向DB中写入多条数据
 internal static int BatchSaveItemsProc(int msgId, List <InnerCacheItem> cacheItemList, int dataVersion)
 {
     if (DataCacheConfig.IsPersistent)
     {
         try {
             foreach (var cacheItem in cacheItemList)
             {
                 DataDML.Save(msgId, cacheItem.Valid, dataVersion, cacheItem.DataMessage);
             }
             LogSys.Log(LOG_TYPE.MONITOR, "BatchSaveItemsProc SUCCESS. MsgId:{0}, DataCount:{1}, DataVersion:{2}", msgId, cacheItemList.Count, dataVersion);
         } catch (Exception ex) {
             DBConn.Close();
             LogSys.Log(LOG_TYPE.ERROR, "BatchSaveItemsProc ERROR. MsgId:{0}, Error:{1}\nStacktrace:{2}", msgId, ex.Message, ex.StackTrace);
             throw ex;
         }
     }
     return(cacheItemList.Count);
 }