예제 #1
0
        private void NativeQueryOptimizerNotLoaded(Exception exception)
        {
            DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor();

            if (dp.Enabled())
            {
                dp.NativeQueryOptimizerNotLoaded(Db4o.Diagnostic.NativeQueryOptimizerNotLoaded.NqNotPresent, exception);
            }
        }
예제 #2
0
        private void NativeQueryUnoptimized(Exception e)
        {
            DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor();

            if (dp.Enabled())
            {
                dp.NativeQueryUnoptimized(null, e);
            }
        }
        public virtual void DefragmentRecommended()
        {
            DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor();

            if (dp.Enabled())
            {
                dp.DefragmentRecommended(DefragmentRecommendation.DefragmentRecommendationReason.
                                         DeleteEmbeded);
            }
        }
예제 #4
0
        internal void LoadFromClassIndex()
        {
            if (!IsEmpty())
            {
                return;
            }
            _result.LoadFromClassIndex(_classMetadata.Index());
            DiagnosticProcessor dp = i_trans.Container()._handlers.DiagnosticProcessor();

            if (dp.Enabled() && !IsClassOnlyQuery())
            {
                dp.LoadedFromClassIndex(_classMetadata);
            }
            _loadedFromClassIndex = true;
        }
예제 #5
0
        internal void LoadFromClassIndex()
        {
            if (!IsEmpty())
            {
                return;
            }
            QCandidates.TreeIntBuilder result = new QCandidates.TreeIntBuilder();
            IClassIndexStrategy        index  = i_classMetadata.Index();

            index.TraverseAll(i_trans, new _IVisitor4_346(this, result));
            i_root = result.tree;
            DiagnosticProcessor dp = i_trans.Container()._handlers.DiagnosticProcessor();

            if (dp.Enabled() && !IsClassOnlyQuery())
            {
                dp.LoadedFromClassIndex(i_classMetadata);
            }
            _loadedFromClassIndex = true;
        }
예제 #6
0
            public void OnClassRegistered(ClassMetadata clazz)
            {
                // if(Platform4.isDb4oClass(clazz.getName())) {
                // return;
                // }
                IReflectClass reflectClass = clazz.ClassReflector();

                if (this.ActivatableClass().IsAssignableFrom(reflectClass))
                {
                    return;
                }
                if (this.HasNoActivatingFields(reflectClass))
                {
                    return;
                }
                NotTransparentActivationEnabled diagnostic = new NotTransparentActivationEnabled(
                    clazz);
                DiagnosticProcessor processor = this._container.Handlers.DiagnosticProcessor();

                processor.OnDiagnostic(diagnostic);
            }
예제 #7
0
        private Db4objects.Db4o.Query.IQuery ConfigureQuery(Db4objects.Db4o.Query.IQuery query, Db4objects.Db4o.Query.Predicate predicate)
        {
            IDb4oEnhancedFilter filter = predicate as IDb4oEnhancedFilter;

            if (null != filter)
            {
                filter.OptimizeQuery(query);
                OnQueryExecution(predicate, QueryExecutionKind.PreOptimized);
                return(query);
            }

            query.Constrain(predicate.ExtentType());

            try
            {
                if (OptimizeNativeQueries())
                {
                    OptimizeQuery(query, predicate, predicate.GetFilterMethod());
                    OnQueryExecution(predicate, QueryExecutionKind.DynamicallyOptimized);
                    return(query);
                }
            }
            catch (System.Exception e)
            {
                OnQueryOptimizationFailure(e);

                if (OptimizeNativeQueries())
                {
                    DiagnosticProcessor dp = Container()._handlers.DiagnosticProcessor();
                    if (dp.Enabled())
                    {
                        dp.NativeQueryUnoptimized(predicate, e);
                    }
                }
            }

            query.Constrain(new Db4objects.Db4o.Internal.Query.PredicateEvaluation(predicate));
            OnQueryExecution(predicate, QueryExecutionKind.Unoptimized);
            return(query);
        }
예제 #8
0
 internal HandlerRegistry(ObjectContainerBase container, byte stringEncoding, GenericReflector
                          reflector)
 {
     // this is the master container and not valid
     // for TransportObjectContainer
     _handlerVersions = new HandlerVersionRegistry(this);
     _stringIO        = BuiltInStringEncoding.StringIoForEncoding(stringEncoding, container.ConfigImpl
                                                                  .StringEncoding());
     _container           = container;
     container._handlers  = this;
     _reflector           = reflector;
     _diagnosticProcessor = container.ConfigImpl.DiagnosticProcessor();
     InitClassReflectors(reflector);
     _indexes          = new SharedIndexedFields();
     _virtualFields[0] = _indexes._version;
     _virtualFields[1] = _indexes._uUID;
     _virtualFields[2] = _indexes._commitTimestamp;
     RegisterBuiltinHandlers();
     RegisterPlatformTypes();
     InitArrayHandlers();
     Platform4.RegisterPlatformHandlers(container);
 }