Esempio n. 1
0
 public DefaultServerIdManager(NeoDatis.Odb.Core.Layers.Layer3.IObjectWriter objectWriter
                               , NeoDatis.Odb.Core.Layers.Layer3.IObjectReader objectReader, long currentBlockIdPosition
                               , int currentBlockIdNumber, NeoDatis.Odb.OID currentMaxId) : base(objectWriter,
                                                                                                 objectReader, currentBlockIdPosition, currentBlockIdNumber, currentMaxId)
 {
     sessionManager = NeoDatis.Odb.OdbConfiguration.GetCoreProvider().GetClientServerSessionManager
                          ();
 }
 public virtual void Clear()
 {
     objectReader    = null;
     objectWriter    = null;
     session         = null;
     lastIdPositions = null;
     lastIds         = null;
 }
Esempio n. 3
0
 public GenericQueryExecutor(NeoDatis.Odb.Core.Query.IQuery query, NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine
                             engine)
 {
     this.query         = query;
     this.storageEngine = engine;
     this.objectReader  = storageEngine.GetObjectReader();
     this.session       = storageEngine.GetSession(true);
     this.callback      = NeoDatis.Odb.OdbConfiguration.GetQueryExecutorCallback();
     this.executeStartAndEndOfQueryAction = true;
 }
Esempio n. 4
0
 /// <summary>TODO Use a mutex to guarantee unique access to the file at this moment.</summary>
 /// <remarks>
 /// TODO Use a mutex to guarantee unique access to the file at this moment.
 /// This should be change
 /// </remarks>
 /// <param name="query"></param>
 /// <param name="inMemory"></param>
 /// <param name="startIndex"></param>
 /// <param name="endIndex"></param>
 /// <param name="returnOjects"></param>
 /// <returns>The object info list</returns>
 /// <exception cref="System.Exception">System.Exception</exception>
 public override NeoDatis.Odb.Objects <T> GetObjectInfos <T>(NeoDatis.Odb.Core.Query.IQuery
                                                             query, bool inMemory, int startIndex, int endIndex, bool returnOjects)
 {
     try
     {
         NeoDatis.Odb.Core.Layers.Layer3.IObjectReader           reader            = GetObjectReader();
         NeoDatis.Odb.Core.Query.Execution.IMatchingObjectAction queryResultAction = new NeoDatis.Odb.Impl.Core.Query.Criteria.CollectionQueryResultAction <T>
                                                                                         (query, inMemory, this, returnOjects, reader.GetInstanceBuilder());
         return(reader.GetObjectInfos <T>(query, inMemory, startIndex, endIndex, returnOjects,
                                          queryResultAction));
     }
     finally
     {
     }
 }
		public AbstractObjectWriter(NeoDatis.Odb.Core.Layers.Layer3.IStorageEngine engine
			)
		{
			// public ISession session;
			// Just for display matters
			this.storageEngine = engine;
			this.objectReader = storageEngine.GetObjectReader();
			this.isLocalMode = this.storageEngine.IsLocal();
			NeoDatis.Odb.Core.ICoreProvider provider = NeoDatis.Odb.OdbConfiguration.GetCoreProvider
				();
			this.byteArrayConverter = provider.GetByteArrayConverter();
			this.classIntrospector = provider.GetClassIntrospector();
			NativeHeaderBlockSizeByte = byteArrayConverter.IntToByteArray(NativeHeaderBlockSize
				);
			comparator = new NeoDatis.Odb.Impl.Core.Layers.Layer2.Meta.Compare.ObjectInfoComparator
				();
		}
 /// <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;
 }
		/// <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;
		}
		public virtual void Clear()
		{
			objectReader = null;
			objectWriter = null;
			session = null;
			lastIdPositions = null;
			lastIds = null;
		}
		public virtual void AfterInit()
		{
			this.objectReader = storageEngine.GetObjectReader();
			this.idManager = NeoDatis.Odb.OdbConfiguration.GetCoreProvider().GetClientIdManager
				(storageEngine);
		}
		public virtual void Close()
		{
			objectReader = null;
			if (idManager != null)
			{
				idManager.Clear();
				idManager = null;
			}
			storageEngine = null;
			fsi.Close();
			fsi = null;
		}