Exemplo n.º 1
0
        public bool TryExecuteDynamicQuery(EntitySession session, LinqCommand command, out object result)
        {
            result = null;
            if (!CheckFullSetCacheCurrent(session))
            {
                return(false);
            }
            var cmdInfo = command.Info;
            //try getting previously compiled version or compile it
            var cacheQuery = GetCacheQuery(command);

            if (cacheQuery == null)
            {
                return(false);
            }
            var start = _timeService.ElapsedMilliseconds;

            result = cacheQuery.CacheFunc(session, this, command.ParameterValues);
            var end      = _timeService.ElapsedMilliseconds;
            var logEntry = new CacheQueryLogEntry(session.Context, cacheQuery.LogString, command.ParameterValues,
                                                  _timeService.UtcNow, end - start, GetRowCount(result));

            session.AddLogEntry(logEntry);
            session.Context.EntityCacheVersion = CurrentVersion;
            return(true);
        }
Exemplo n.º 2
0
        protected void LogComment(EntitySession session, string comment, params object[] args)
        {
            if (!session.LogEnabled)
            {
                return;
            }
            var entry = new InfoLogEntry(session.Context.LogContext, comment, args);

            session.AddLogEntry(entry);
        }
Exemplo n.º 3
0
        private void LogCommand(EntitySession session, IDbCommand command, long executionTime, int rowCount = -1)
        {
            if (session.LogDisabled)
            {
                return;
            }
            var entry = new DbCommandLogEntry(session.Context, command, DbModel.Driver.CommandCallFormat, _timeService.UtcNow, executionTime, rowCount);

            session.AddLogEntry(entry);
        }
Exemplo n.º 4
0
 protected void LogException(EntitySession session, Exception ex) {
   if(!session.LogEnabled)
     return;
   var entry = new ErrorLogEntry(session.Context, ex);
   session.AddLogEntry(entry);
 }
Exemplo n.º 5
0
 private void LogCommand(EntitySession session, EntityCommand command, object[] args, CacheType cachingType, long time, int rowCount)
 {
     var logEntry = new CacheCommandLogEntry(session.Context, command.CommandName, args, _timeService.UtcNow, time, rowCount, cachingType);
       session.AddLogEntry(logEntry);
 }
Exemplo n.º 6
0
        private void LogCommand(EntitySession session, EntityCommand command, object[] args, CacheType cachingType, long time, int rowCount)
        {
            var logEntry = new CacheCommandLogEntry(session.Context, command.CommandName, args, _timeService.UtcNow, time, rowCount, cachingType);

            session.AddLogEntry(logEntry);
        }
Exemplo n.º 7
0
        protected void LogException(EntitySession session, Exception ex)
        {
            var entry = new ErrorLogEntry(session.Context, ex);

            session.AddLogEntry(entry);
        }
Exemplo n.º 8
0
 private void LogCommand(EntitySession session, IDbCommand command, long executionTime, int rowCount = -1)
 {
     if (session.LogDisabled)
     return;
       var entry = new DbCommandLogEntry(session.Context, command, DbModel.Driver.CommandCallFormat, _timeService.UtcNow, executionTime, rowCount);
       session.AddLogEntry(entry);
 }
Exemplo n.º 9
0
 protected void LogException(EntitySession session, Exception ex)
 {
     var entry = new ErrorLogEntry(session.Context, ex);
       session.AddLogEntry(entry);
 }
Exemplo n.º 10
0
 protected void LogComment(EntitySession session, string comment, params object[] args)
 {
     if (session.LogDisabled)
     return;
       var entry = new InfoLogEntry(session.Context, comment, args);
       session.AddLogEntry(entry);
 }