Example #1
0
 public virtual NeoDatis.Odb.Objects <T> Execute <T>(bool inMemory, int startIndex,
                                                     int endIndex, bool returnObjects, NeoDatis.Odb.Core.Query.Execution.IMatchingObjectAction
                                                     queryResultAction)
 {
     if (storageEngine.IsClosed())
     {
         throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.OdbIsClosed
                                                    .AddParameter(storageEngine.GetBaseIdentification().GetIdentification()));
     }
     if (session.IsRollbacked())
     {
         throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.OdbHasBeenRollbacked
                                                    );
     }
     // When used as MultiClass Executor, classInfo is already set
     if (classInfo == null)
     {
         // Class to execute query on
         string fullClassName = NeoDatis.Odb.Core.Query.QueryManager.GetFullClassName(query
                                                                                      );
         // If the query class does not exist in meta model, return an empty
         // collection
         if (!session.GetMetaModel().ExistClass(fullClassName))
         {
             queryResultAction.Start();
             queryResultAction.End();
             query.SetExecutionPlan(new NeoDatis.Odb.Core.Query.Execution.EmptyExecutionPlan()
                                    );
             return(queryResultAction.GetObjects <T>());
         }
         classInfo = session.GetMetaModel().GetClassInfo(fullClassName, true);
     }
     // Get the query execution plan
     NeoDatis.Odb.Core.Query.Execution.IQueryExecutionPlan plan = GetExecutionPlan();
     plan.Start();
     try
     {
         if (plan.UseIndex() && NeoDatis.Odb.OdbConfiguration.UseIndex())
         {
             return(ExecuteUsingIndex <T>(plan.GetIndex(), inMemory, startIndex, endIndex, returnObjects
                                          , queryResultAction));
         }
         // When query must be applied to a single object
         if (query.IsForSingleOid())
         {
             return(ExecuteForOneOid <T>(inMemory, returnObjects, queryResultAction));
         }
         return(ExecuteFullScan <T>(inMemory, startIndex, endIndex, returnObjects, queryResultAction
                                    ));
     }
     finally
     {
         plan.End();
     }
 }
Example #2
0
 public Connection(NeoDatis.Odb.Core.Server.Connection.ConnectionManager connectionManager
                   , string connectionId, NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine storageEngine
                   )
 {
     this.connectionManager = connectionManager;
     this.id                  = connectionId;
     this.storageEngine       = storageEngine;
     this.baseIdentifier      = storageEngine.GetBaseIdentification().GetIdentification();
     this.oidsLockedForUpdate = new System.Collections.Generic.Dictionary <NeoDatis.Odb.OID
                                                                           , long>();
     actions = new int[NeoDatis.Odb.Core.Server.Connection.ConnectionAction.GetNumberOfActions
                           ()];
 }
 public DefaultServerConnection(NeoDatis.Odb.Core.Server.Connection.ConnectionManager
                                connectionManager, string connectionId, NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine
                                storageEngine)
 {
     this.connectionManager = connectionManager;
     this.id                  = connectionId;
     this.storageEngine       = storageEngine;
     this.baseIdentifier      = storageEngine.GetBaseIdentification().GetIdentification();
     this.oidsLockedForUpdate = new NeoDatis.Tool.Wrappers.Map.OdbHashMap <NeoDatis.Odb.OID
                                                                           , long>();
     actions = new int[NeoDatis.Odb.Core.Server.Connection.ConnectionAction.GetNumberOfActions
                           ()];
 }
		public DefaultServerConnection(NeoDatis.Odb.Core.Server.Connection.ConnectionManager
			 connectionManager, string connectionId, NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine
			 storageEngine)
		{
			this.connectionManager = connectionManager;
			this.id = connectionId;
			this.storageEngine = storageEngine;
			this.baseIdentifier = storageEngine.GetBaseIdentification().GetIdentification();
			this.oidsLockedForUpdate = new NeoDatis.Tool.Wrappers.Map.OdbHashMap<NeoDatis.Odb.OID
				, long>();
			actions = new int[NeoDatis.Odb.Core.Server.Connection.ConnectionAction.GetNumberOfActions
				()];
		}
Example #5
0
		public Connection(NeoDatis.Odb.Core.Server.Connection.ConnectionManager connectionManager
			, string connectionId, NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine storageEngine
			)
		{
			this.connectionManager = connectionManager;
			this.id = connectionId;
			this.storageEngine = storageEngine;
			this.baseIdentifier = storageEngine.GetBaseIdentification().GetIdentification();
			this.oidsLockedForUpdate = new System.Collections.Generic.Dictionary<NeoDatis.Odb.OID
				, long>();
			actions = new int[NeoDatis.Odb.Core.Server.Connection.ConnectionAction.GetNumberOfActions
				()];
		}
Example #6
0
 public DefaultInstrumentationCallbackForStore(NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine
                                               engine, NeoDatis.Odb.Core.Trigger.ITriggerManager triggerManager, bool isUpdate
                                               ) : base()
 {
     this.engine         = engine;
     this.triggerManager = triggerManager;
     this.isUpdate       = isUpdate;
     // Just for junits
     if (engine != null)
     {
         this.crossSessionCache = NeoDatis.Odb.Impl.Core.Transaction.CacheFactory.GetCrossSessionCache
                                      (engine.GetBaseIdentification().GetIdentification());
     }
 }
		public DefaultInstrumentationCallbackForStore(NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine
			 engine, NeoDatis.Odb.Core.Trigger.ITriggerManager triggerManager, bool isUpdate
			) : base()
		{
			this.engine = engine;
			this.triggerManager = triggerManager;
			this.isUpdate = isUpdate;
			// Just for junits
			if (engine != null)
			{
				this.crossSessionCache = NeoDatis.Odb.Impl.Core.Transaction.CacheFactory.GetCrossSessionCache
					(engine.GetBaseIdentification().GetIdentification());
			}
		}
Example #8
0
        public virtual void Test1()
        {
            string baseName = "name.neodatis";

            NeoDatis.Odb.ODB odb = Open(baseName);
            NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.Dummy
                                                                    .GetEngine(odb);
            string s = engine.GetBaseIdentification().GetIdentification();

            if (isLocal)
            {
                AssertEquals(baseName, s);
            }
            else
            {
                AssertEquals("unit-test-data/[email protected]:13000", s);
            }
        }
 public ClientSession(NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine) : base
         ("client", engine.GetBaseIdentification().GetIdentification())
 {
     this.engine = engine;
 }
 public virtual string GetName()
 {
     return(storageEngine.GetBaseIdentification().GetIdentification());
 }
Example #11
0
 public LocalSession(NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine, string
                     sessionId) : base(sessionId, engine.GetBaseIdentification().GetIdentification()
                                       )
 {
     this.storageEngine = engine;
 }