public ObjectInfoHeader() : base()
		{
			this.position = -1;
			this.oid = null;
			this.objectVersion = 1;
			this.creationDate = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
		}
		public PendingReading(int id, NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci, 
			NeoDatis.Odb.OID attributeOID) : base()
		{
			this.id = id;
			this.ci = ci;
			this.attributeOID = attributeOID;
		}
		public CIZoneInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci, NeoDatis.Odb.OID
			 first, NeoDatis.Odb.OID last, long nbObjects) : base()
		{
			this.first = first;
			this.last = last;
			this.nbObjects = nbObjects;
			this.ci = ci;
		}
		public InsertHistoryInfo(string type, NeoDatis.Odb.OID oid, long position, NeoDatis.Odb.OID
			 prev, NeoDatis.Odb.OID next) : base()
		{
			this.type = type;
			this.position = position;
			this.oid = oid;
			this.next = next;
			this.prev = prev;
		}
		public StoreMessageResponse(string baseId, string connectionId, NeoDatis.Odb.OID 
			oid, bool newObject, NeoDatis.Odb.OID[] clientIds, NeoDatis.Odb.OID[] serverIds)
			 : base(NeoDatis.Odb.Core.Server.Layers.Layer3.Engine.Command.Store, baseId, connectionId
			)
		{
			this.oid = oid;
			this.newObject = newObject;
			this.clientIds = clientIds;
			this.serverIds = serverIds;
		}
		public override void Execute(NeoDatis.Odb.OID oid, NeoDatis.Odb.Core.Layers.Layer2.Meta.AttributeValuesMap
			 values)
		{
			System.Decimal n = (System.Decimal)values[attributeName];
			System.Decimal bd = NeoDatis.Odb.Impl.Core.Query.Values.ValuesUtil.Convert(n);
			if (minValue.CompareTo(bd) > 0)
			{
				oidOfMinValues = oid;
				minValue = bd;
			}
		}
		public FullIDInfo(long id, long position, byte idStatus, long blockId, string objectClassName
			, string objectToString, NeoDatis.Odb.OID prevOID, NeoDatis.Odb.OID nextOID)
		{
			this.id = id;
			this.position = position;
			this.blockId = blockId;
			this.objectClassName = objectClassName;
			this.objectToString = objectToString;
			this.idStatus = idStatus;
			this.prevOID = prevOID;
			this.nextOID = nextOID;
		}
		public ObjectInfoHeader(long position, NeoDatis.Odb.OID previousObjectOID, NeoDatis.Odb.OID
			 nextObjectOID, NeoDatis.Odb.OID classInfoId, long[] attributesIdentification, int
			[] attributeIds)
		{
			this.position = position;
			this.oid = null;
			this.previousObjectOID = previousObjectOID;
			this.nextObjectOID = nextObjectOID;
			this.classInfoId = classInfoId;
			this.attributesIdentification = attributesIdentification;
			this.attributeIds = attributeIds;
			this.objectVersion = 1;
			this.creationDate = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
		}
		/// <exception cref="System.Exception"></exception>
		public virtual void T1estC1()
		{
			test.DeleteBase("acid1");
			NeoDatis.Odb.ODB odb = test.Open("acid1");
			int size = 1;
			NeoDatis.Odb.OID[] oids = new NeoDatis.Odb.OID[size];
			for (int i = 0; i < size; i++)
			{
				oids[i] = odb.Store(GetInstance("f" + i));
			}
			for (int i = 0; i < size; i++)
			{
				odb.DeleteObjectWithId(oids[i]);
			}
		}
		public override void SetParent(NeoDatis.Btree.IBTreeNode node)
		{
			parent = node;
			if (parent != null)
			{
				if (parent.GetId() == null)
				{
					btree.GetPersister().SaveNode(parent);
				}
				parentOid = (NeoDatis.Odb.OID)parent.GetId();
			}
			else
			{
				parentOid = null;
			}
		}
		/// <param name="objectWriter">The object writer</param>
		/// <param name="objectReader">The object reader</param>
		/// <param name="currentBlockIdPosition">The position of the current block</param>
		/// <param name="currentBlockIdNumber">The number of the current block</param>
		/// <param name="currentMaxId">Maximum Database id</param>
		public DefaultIdManager(NeoDatis.Odb.Core.Layers.Layer3.IObjectWriter objectWriter
			, NeoDatis.Odb.Core.Layers.Layer3.IObjectReader objectReader, long currentBlockIdPosition
			, int currentBlockIdNumber, NeoDatis.Odb.OID currentMaxId)
		{
			this.provider = NeoDatis.Odb.OdbConfiguration.GetCoreProvider();
			this.objectWriter = objectWriter;
			this.objectReader = objectReader;
			this.session = objectWriter.GetSession();
			this.currentBlockIdPosition = currentBlockIdPosition;
			this.currentBlockIdNumber = currentBlockIdNumber;
			this.maxId = provider.GetObjectOID((long)currentBlockIdNumber * NeoDatis.Odb.OdbConfiguration
				.GetNB_IDS_PER_BLOCK(), 0);
			this.nextId = provider.GetObjectOID(currentMaxId.GetObjectId() + 1, 0);
			lastIds = new NeoDatis.Odb.OID[IdBufferSize];
			for (int i = 0; i < IdBufferSize; i++)
			{
				lastIds[i] = NeoDatis.Odb.Impl.Core.Layers.Layer3.Engine.StorageEngineConstant.NullObjectId;
			}
			lastIdPositions = new long[IdBufferSize];
			lastIdIndex = 0;
		}
Exemple #12
0
 protected override void Init()
 {
     childrenOids = new NeoDatis.Odb.OID[maxNbChildren];
     parentOid    = null;
     parent       = null;
 }
Exemple #13
0
 public virtual void SetOidOfObjectToQuery(NeoDatis.Odb.OID oidOfObjectToQuery)
 {
     this.oidOfObjectToQuery = oidOfObjectToQuery;
 }
Exemple #14
0
 public abstract void AfterDelete(NeoDatis.Odb.ObjectRepresentation objectRepresentation
                                  , NeoDatis.Odb.OID oid);
		public virtual void SetClassInfoId(NeoDatis.Odb.OID classInfoId)
		{
			this.classInfoId = classInfoId;
		}
Exemple #16
0
 public abstract bool BeforeUpdate(NeoDatis.Odb.ObjectRepresentation oldObjectRepresentation
                                   , object newObject, NeoDatis.Odb.OID oid);
		public virtual void SetPreviousObjectOID(NeoDatis.Odb.OID previousObjectOID)
		{
			this.previousObjectOID = previousObjectOID;
		}
Exemple #18
0
 public virtual NeoDatis.Odb.ExternalOID ConvertToExternalOID(NeoDatis.Odb.OID oid
                                                              )
 {
     return(new NeoDatis.Odb.Impl.Core.Oid.ExternalObjectOID(oid, engine.GetDatabaseId
                                                                 ()));
 }
		public ObjectReference(NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi
			) : base(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType.NonNativeId)
		{
			this.id = null;
			this.nnoi = nnoi;
		}
 public abstract bool BeforeDelete(object @object, NeoDatis.Odb.OID oid);
 public abstract void AfterDelete(object @object, NeoDatis.Odb.OID oid);
Exemple #22
0
		public virtual void SetOidOfObjectToQuery(NeoDatis.Odb.OID oidOfObjectToQuery)
		{
			this.oidOfObjectToQuery = oidOfObjectToQuery;
		}
Exemple #23
0
 public override bool BeforeDelete(object @object, NeoDatis.Odb.OID oid)
 {
     return(BeforeDelete((NeoDatis.Odb.ObjectRepresentation)@object, oid));
 }
Exemple #24
0
 public override void AfterDelete(object @object, NeoDatis.Odb.OID oid)
 {
     AfterDelete((NeoDatis.Odb.ObjectRepresentation)@object, oid);
 }
Exemple #25
0
 public virtual void AfterInsert(object @object, NeoDatis.Odb.OID oid)
 {
 }
Exemple #26
0
 public virtual void SetClassInfoId(string fullClassName, NeoDatis.Odb.OID id)
 {
     classInfoIds.Add(fullClassName, id);
 }
		public override void Ready()
		{
			if (!objectIsNative)
			{
				if (GetQuery() == null)
				{
					throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.ContainsQueryWithNoQuery
						);
				}
				NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine = GetQuery().GetStorageEngine
					();
				if (engine == null)
				{
					throw new NeoDatis.Odb.ODBRuntimeException(NeoDatis.Odb.Core.NeoDatisError.ContainsQueryWithNoStorageEngine
						);
				}
				// For non native object, we just need the oid of it
				oid = engine.GetObjectId(criterionValue, false);
				this.criterionValue = null;
			}
		}
		public virtual void SetNextClassOID(NeoDatis.Odb.OID nextClassOID)
		{
			this.nextClassOID = nextClassOID;
		}
Exemple #29
0
 public virtual bool ObjectWithIdIsInCommitedZone(NeoDatis.Odb.OID oid)
 {
     return(!unconnectedZoneOids.ContainsKey(oid));
 }
Exemple #30
0
        public virtual void Test7()
		{
			DeleteBase("getid.neodatis");
			int size = isLocal ? 10001 : 1000;
			NeoDatis.Odb.ODB odb = Open("getid.neodatis");
			NeoDatis.Odb.OID[] oids = new NeoDatis.Odb.OID[size];
			for (int i = 0; i < size; i++)
			{
				oids[i] = odb.Store(GetInstance(i));
			}
			odb.Close();
			odb = Open("getid.neodatis");
			long t1 = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			for (int i = 0; i < size; i++)
			{
				NeoDatis.Odb.Test.VO.Login.User u = (NeoDatis.Odb.Test.VO.Login.User)odb.GetObjectFromId
					(oids[i]);
				AssertEquals("kiko" + i, u.GetName());
			}
			long t2 = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			odb.Close();
			DeleteBase("getid.neodatis");
			long time = t2 - t1;
			double timeForEachGet = (double)time / (double)size;
			double acceptableTime = isLocal ? 0.086 : 1.6;
			// 0.1561843815618438
			Println("time for each get = " + timeForEachGet + " - Total time for " + size + " objects = "
				 + time);
			if (testPerformance && timeForEachGet > acceptableTime)
			{
				// ms
				Println("time for each get = " + timeForEachGet + " - Total time for " + size + " objects = "
					 + time);
				Fail("Getting " + size + " complex objects by oid lasted more than " + acceptableTime
					 + "ms : " + timeForEachGet);
			}
		}
		public GetObjectHeaderFromIdMessage(string baseId, string connectionId, NeoDatis.Odb.OID
			 oid) : base(NeoDatis.Odb.Core.Server.Layers.Layer3.Engine.Command.GetObjectHeaderFromId
			, baseId, connectionId)
		{
			this.oid = oid;
		}
		private long AssociateIdToObject(byte idType, byte idStatus, long objectPosition)
		{
			long idPosition = objectWriter.AssociateIdToObject(idType, idStatus, currentBlockIdPosition
				, nextId, objectPosition, false);
			nextId = provider.GetObjectOID(nextId.GetObjectId() + 1, 0);
			return idPosition;
		}
		public virtual void SetPreviousClassOID(NeoDatis.Odb.OID previousClassOID)
		{
			this.previousClassOID = previousClassOID;
		}
Exemple #34
0
 public abstract bool BeforeDelete(NeoDatis.Odb.ObjectRepresentation objectRepresentation
                                   , NeoDatis.Odb.OID oid);
Exemple #35
0
 public override void AfterSelect(object @object, NeoDatis.Odb.OID oid)
 {
     nbCalls++;
     System.Console.Out.WriteLine("Select on object with oid " + oid);
 }
		public virtual void SetId(NeoDatis.Odb.OID id)
		{
			this.id = id;
		}
 public override void Execute(NeoDatis.Odb.OID oid, NeoDatis.Odb.Core.Layers.Layer2.Meta.AttributeValuesMap
                              values)
 {
     count = NeoDatis.Tool.Wrappers.NeoDatisNumber.Add(count, One);
 }
		public ClassInfo()
		{
			this.original = new CommittedCIZoneInfo(this
				, null, null, 0);
			this.committed = new CommittedCIZoneInfo(this
				, null, null, 0);
			this.uncommitted = new CIZoneInfo(this, null
				, null, 0);
			this.previousClassOID = null;
			this.nextClassOID = null;
			this.blockSize = -1;
			this.position = -1;
			this.maxAttributeId = -1;
			this.classCategory = CategoryUserClass;
			this.history = new NeoDatis.Tool.Wrappers.List.OdbArrayList<object>();
		}
Exemple #39
0
 public override void SetId(object id)
 {
     this.oid = (NeoDatis.Odb.OID)id;
 }
Exemple #40
0
 public virtual void TestSelectUnCommitedObject4()
 {
     DeleteBase(BaseName);
     // Create instance
     NeoDatis.Odb.Test.VO.Sport.Sport sport = new NeoDatis.Odb.Test.VO.Sport.Sport("volley-ball"
                                                                                   );
     NeoDatis.Odb.ODB odb = null;
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Store the object
         odb.Store(sport);
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     // Create instance
     NeoDatis.Odb.Test.VO.Sport.Sport volleyball = new NeoDatis.Odb.Test.VO.Sport.Sport
                                                       ("volley-ball");
     // Create 4 players
     NeoDatis.Odb.Test.VO.Sport.Player player1 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("olivier", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player2 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("pierre", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player3 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("elohim", new System.DateTime(), volleyball);
     NeoDatis.Odb.Test.VO.Sport.Player player4 = new NeoDatis.Odb.Test.VO.Sport.Player
                                                     ("minh", new System.DateTime(), volleyball);
     // Create two teams
     NeoDatis.Odb.Test.VO.Sport.Team team1 = new NeoDatis.Odb.Test.VO.Sport.Team("Paris"
                                                                                 );
     NeoDatis.Odb.Test.VO.Sport.Team team2 = new NeoDatis.Odb.Test.VO.Sport.Team("Montpellier"
                                                                                 );
     // Set players for team1
     team1.AddPlayer(player1);
     team1.AddPlayer(player2);
     // Set players for team2
     team2.AddPlayer(player3);
     team2.AddPlayer(player4);
     // Then create a volley ball game for the two teams
     NeoDatis.Odb.Test.VO.Sport.Game game = new NeoDatis.Odb.Test.VO.Sport.Game(new System.DateTime
                                                                                    (), volleyball, team1, team2);
     odb = null;
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Store the object
         odb.Store(game);
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     try
     {
         // Open the database
         odb = Open(BaseName);
         NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
                                                    .Equal("name", "olivier"));
         NeoDatis.Odb.Objects <Player> players = odb.GetObjects <Player>(query);
         Println("\nStep 3 : Players with name olivier");
         int i = 1;
         // display each object
         while (players.HasNext())
         {
             Println((i++) + "\t: " + players.Next());
         }
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     try
     {
         // Open the database
         odb = Open(BaseName);
         // Let's insert a tennis player
         NeoDatis.Odb.Test.VO.Sport.Player agassi = new NeoDatis.Odb.Test.VO.Sport.Player(
             "André Agassi", new System.DateTime(), new NeoDatis.Odb.Test.VO.Sport.Sport("Tennis"
                                                                                          ));
         NeoDatis.Odb.OID oid = odb.Store(agassi);
         NeoDatis.Odb.Core.Query.IQuery query = new NeoDatis.Odb.Impl.Core.Query.Criteria.CriteriaQuery
                                                    (typeof(NeoDatis.Odb.Test.VO.Sport.Player), NeoDatis.Odb.Core.Query.Criteria.Where
                                                    .Equal("favoriteSport.name", "volley-ball"));
         NeoDatis.Odb.Objects <Player> players = odb.GetObjects <Player>(query);
         Println("\nStep 4 : Players of Voller-ball");
         int i = 1;
         // display each object
         while (players.HasNext())
         {
             Println((i++) + "\t: " + players.Next());
         }
     }
     finally
     {
         if (odb != null)
         {
             // Close the database
             odb.Close();
         }
     }
     DeleteBase(BaseName);
 }
Exemple #41
0
 public CommittedCIZoneInfo(NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci, NeoDatis.Odb.OID
                            first, NeoDatis.Odb.OID last, long nbObjects) : base(ci, first, last, nbObjects
                                                                                 )
 {
     nbDeletedObjects = 0;
 }
		public DeleteObjectMessageResponse(string baseId, string connectionId, NeoDatis.Odb.OID
			 oid) : base(NeoDatis.Odb.Core.Server.Layers.Layer3.Engine.Command.Store, baseId
			, connectionId)
		{
			this.oid = oid;
		}
Exemple #43
0
 public override void AfterUpdate(NeoDatis.Odb.ObjectRepresentation oldObjectRepresentation
                                  , object newObject, NeoDatis.Odb.OID oid)
 {
 }
 public virtual void AddOid(NeoDatis.Odb.OID oid, NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo
                            nnoi)
 {
     oidsOfNNoi.Add(oid, nnoi);
 }
Exemple #45
0
 /// <summary>
 /// Used to commit meta model : classes This is useful when running in client
 /// server mode TODO Check this
 /// </summary>
 protected virtual void CommitMetaModel()
 {
     NeoDatis.Odb.Core.Layers.Layer2.Meta.MetaModel sessionMetaModel = session.GetMetaModel
                                                                           ();
     // If meta model has not been modified, there is nothing to do
     if (!sessionMetaModel.HasChanged())
     {
         return;
     }
     if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
     {
         NeoDatis.Tool.DLogger.Debug("Start commitMetaModel");
     }
     NeoDatis.Odb.Core.Layers.Layer2.Meta.MetaModel lastCommitedMetaModel = new NeoDatis.Odb.Core.Layers.Layer2.Meta.SessionMetaModel
                                                                                ();
     if (isLocal)
     {
         // In local mode, we must not reload the meta model as there is no
         // concurrent access
         lastCommitedMetaModel = sessionMetaModel;
     }
     else
     {
         // In ClientServer mode, re-read the meta-model from the database
         // base to get last update.
         lastCommitedMetaModel = session.GetStorageEngine().GetObjectReader().ReadMetaModel
                                     (lastCommitedMetaModel, false);
     }
     // Gets the classes that have changed (that have modified ,deleted or
     // inserted objects)
     System.Collections.Generic.IEnumerator <NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo
                                             >      cis             = sessionMetaModel.GetChangedClassInfo().GetEnumerator();
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo newCi           = null;
     NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo lastCommittedCI = null;
     NeoDatis.Odb.Core.Layers.Layer3.IObjectWriter  writer          = session.GetStorageEngine()
                                                                      .GetObjectWriter();
     NeoDatis.Odb.OID lastCommittedObjectOIDOfThisTransaction = null;
     NeoDatis.Odb.OID lastCommittedObjectOIDOfPrevTransaction = null;
     // for all changes between old and new meta model
     while (cis.MoveNext())
     {
         newCi = cis.Current;
         if (lastCommitedMetaModel.ExistClass(newCi.GetFullClassName()))
         {
             // The last CI represents the last committed meta model of the
             // database
             lastCommittedCI = lastCommitedMetaModel.GetClassInfoFromId(newCi.GetId());
             // Just be careful to keep track of current CI committed zone
             // deleted objects
             lastCommittedCI.GetCommitedZoneInfo().SetNbDeletedObjects(newCi.GetCommitedZoneInfo
                                                                           ().GetNbDeletedObjects());
         }
         else
         {
             lastCommittedCI = newCi;
         }
         lastCommittedObjectOIDOfThisTransaction = newCi.GetCommitedZoneInfo().last;
         lastCommittedObjectOIDOfPrevTransaction = lastCommittedCI.GetCommitedZoneInfo().last;
         NeoDatis.Odb.OID lastCommittedObjectOID = lastCommittedObjectOIDOfPrevTransaction;
         // If some object have been created then
         if (lastCommittedObjectOIDOfPrevTransaction != null)
         {
             // Checks if last object of committed meta model has not been
             // deleted
             if (session.GetCache().IsDeleted(lastCommittedObjectOIDOfPrevTransaction))
             {
                 // TODO This is wrong: if a committed transaction deleted a
                 // committed object and creates x new
                 // objects, then all these new objects will be lost:
                 // if it has been deleted then use the last object of the
                 // session class info
                 lastCommittedObjectOID = lastCommittedObjectOIDOfThisTransaction;
                 newCi.GetCommitedZoneInfo().last = lastCommittedObjectOID;
             }
         }
         // Connect Unconnected zone to connected zone
         // make next oid of last committed object point to first
         // uncommitted object
         // make previous oid of first uncommitted object point to
         // last committed object
         if (lastCommittedObjectOID != null && newCi.GetUncommittedZoneInfo().HasObjects())
         {
             if (newCi.GetCommitedZoneInfo().HasObjects())
             {
                 // these 2 updates are executed directly without
                 // transaction, because
                 // We are in the commit process.
                 writer.UpdateNextObjectFieldOfObjectInfo(lastCommittedObjectOID, newCi.GetUncommittedZoneInfo
                                                              ().first, false);
                 writer.UpdatePreviousObjectFieldOfObjectInfo(newCi.GetUncommittedZoneInfo().first
                                                              , lastCommittedObjectOID, false);
             }
             else
             {
                 // Committed zone has 0 object
                 writer.UpdatePreviousObjectFieldOfObjectInfo(newCi.GetUncommittedZoneInfo().first
                                                              , null, false);
             }
         }
         // The number of committed objects must be updated with the number
         // of the last committed CI because a transaction may have been
         // committed changing this number.
         // Notice that the setNbObjects receive the full CommittedCIZoneInfo
         // object
         // because it will set the number of objects and the number of
         // deleted objects
         newCi.GetCommitedZoneInfo().SetNbObjects(lastCommittedCI.GetCommitedZoneInfo());
         // and don't forget to set the deleted objects
         // This sets the number of objects, the first object OID and the
         // last object OID
         newCi = BuildClassInfoForCommit(newCi);
         writer.UpdateInstanceFieldsOfClassInfo(newCi, false);
         if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
         {
             NeoDatis.Tool.DLogger.Debug("Analysing class " + newCi.GetFullClassName());
             NeoDatis.Tool.DLogger.Debug("\t-Commited CI   = " + newCi);
             NeoDatis.Tool.DLogger.Debug("\t-connect last commited object with oid " + lastCommittedObjectOID
                                         + " to first uncommited object " + newCi.GetUncommittedZoneInfo().first);
             NeoDatis.Tool.DLogger.Debug("\t-Commiting new Number of objects = " + newCi.GetNumberOfObjects
                                             ());
         }
     }
     sessionMetaModel.ResetChangedClasses();
     // To guarantee integrity after commit, the meta model is set to null
     // If the user continues using odb instance after commit the meta model
     // will be lazy-reloaded. Only for Client Server mode
     if (!isLocal)
     {
         session.SetMetaModel(null);
     }
 }
 public override void StartInsertingObjectWithOid(object @object, NeoDatis.Odb.OID
                                                  oid, NeoDatis.Odb.Core.Layers.Layer2.Meta.NonNativeObjectInfo nnoi)
 {
     base.StartInsertingObjectWithOid(@object, oid, nnoi);
     AddOid(oid, nnoi);
 }
		public ObjectReference(NeoDatis.Odb.OID id) : base(NeoDatis.Odb.Core.Layers.Layer2.Meta.ODBType
			.NonNativeId)
		{
			this.id = id;
		}
        public virtual void UpdateIdStatus(NeoDatis.Odb.OID id, byte newStatus)
        {
            long idPosition = GetIdPosition(id);

            objectWriter.UpdateStatusForIdWithPosition(idPosition, newStatus, true);
        }
		public IdInfo(NeoDatis.Odb.OID oid, long position, byte status) : base()
		{
			this.oid = oid;
			this.position = position;
			this.status = status;
		}
 public virtual long GetObjectPositionWithOid(NeoDatis.Odb.OID oid, bool useCache)
 {
     return(objectReader.GetObjectPositionFromItsOid(oid, useCache, true));
 }
Exemple #51
0
 public virtual void AddOIDToUnconnectedZone(NeoDatis.Odb.OID oid)
 {
     unconnectedZoneOids.Add(oid, oid);
 }
Exemple #52
0
 public abstract void Execute(NeoDatis.Odb.OID oid, NeoDatis.Odb.Core.Layers.Layer2.Meta.AttributeValuesMap
                              values);
Exemple #53
0
 public abstract void AfterUpdate(NeoDatis.Odb.ObjectRepresentation oldObjectRepresentation
                                  , object newObject, NeoDatis.Odb.OID oid);
Exemple #54
0
		public ClassWithOid(string name, NeoDatis.Odb.OID oid) : base()
		{
			this.name = name;
			this.oid = oid;
		}
Exemple #55
0
 public override void AfterInsert(object @object, NeoDatis.Odb.OID oid)
 {
 }
Exemple #56
0
        public virtual void Test6()
		{
			DeleteBase("getid.neodatis");
			int size = isLocal ? 20001 : 2001;
			NeoDatis.Odb.ODB odb = Open("getid.neodatis");
			NeoDatis.Odb.OID[] oids = new NeoDatis.Odb.OID[size];
			for (int i = 0; i < size; i++)
			{
				oids[i] = odb.Store(new NeoDatis.Odb.Test.VO.Login.Function("function " + i));
			}
			odb.Close();
			odb = Open("getid.neodatis");
			long t1 = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			for (int i = 0; i < size; i++)
			{
				NeoDatis.Odb.Test.VO.Login.Function f = (NeoDatis.Odb.Test.VO.Login.Function)odb.
					GetObjectFromId(oids[i]);
				AssertEquals("function " + i, f.GetName());
				if (i % 3000 == 0)
				{
					Println(i + "/" + size);
				}
			}
			long t2 = NeoDatis.Tool.Wrappers.OdbTime.GetCurrentTimeInMs();
			odb.Close();
			DeleteBase("getid.neodatis");
			long time = t2 - t1;
			double timeForEachGet = (double)time / (double)size;
			double acceptableTime = isLocal ? 0.022 : 0.5;
			// 0.04294785260736963
			Println("time for each get = " + time + "/" + size + " = " + timeForEachGet);
			if (testPerformance && timeForEachGet > acceptableTime)
			{
				// ms
				Fail("Getting " + size + " simple objects by oid lasted more than " + acceptableTime
					 + "ms : " + timeForEachGet);
			}
		}
 /// <summary>Gets the class info from the OID.</summary>
 /// <remarks>Gets the class info from the OID.</remarks>
 /// <param name="id"></param>
 /// <returns>the class info with the OID</returns>
 public virtual NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo GetClassInfoFromId(
     NeoDatis.Odb.OID id)
 {
     return(rapidAccessForClassesByOid[id]);
 }
		private void ShiftBlock()
		{
			long currentBlockPosition = this.currentBlockIdPosition;
			// the block has reached the end, , must create a new id block
			long newBlockPosition = CreateNewBlock();
			// Mark the current block as full
			MarkBlockAsFull(currentBlockPosition, newBlockPosition);
			this.currentBlockIdNumber++;
			this.currentBlockIdPosition = newBlockPosition;
			this.maxId = provider.GetObjectOID((long)currentBlockIdNumber * NeoDatis.Odb.OdbConfiguration
				.GetNB_IDS_PER_BLOCK(), 0);
		}
 public override bool BeforeUpdate(NeoDatis.Odb.ObjectRepresentation oldObjectRepresentation
                                   , object newObject, NeoDatis.Odb.OID oid)
 {
     return(BeforeUpdate(oldObjectRepresentation, (NeoDatis.Odb.ObjectRepresentation)newObject
                         , oid));
 }
Exemple #60
0
		public virtual void SetOid(NeoDatis.Odb.OID oid)
		{
			this.oid = oid;
		}