示例#1
0
		internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
			 a_field)
		{
			// Transaction necessary as reference to stream
			// root of the QCandidate tree
			// collection of all constraints
			// possible class information
			// possible field information
			// current executing constraint, only set where needed
			i_trans = a_trans;
			i_classMetadata = a_classMetadata;
			_field = a_field;
			if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
				.GetHandler() is StandardReferenceTypeHandler))
			{
				return;
			}
			ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
				()).ClassMetadata();
			if (i_classMetadata == null)
			{
				i_classMetadata = yc;
			}
			else
			{
				yc = i_classMetadata.GetHigherOrCommonHierarchy(yc);
				if (yc != null)
				{
					i_classMetadata = yc;
				}
			}
		}
示例#2
0
 public _ICallbackInfoCollector_297(LocalTransaction _enclosing, Collection4 added
                                    , Collection4 updated)
 {
     this._enclosing = _enclosing;
     this.added      = added;
     this.updated    = updated;
 }
示例#3
0
		internal QCandidates(LocalTransaction a_trans, ClassMetadata a_classMetadata, QField
			 a_field, bool isTopLevel)
		{
			// Transaction necessary as reference to stream
			// collection of all constraints
			// possible class information
			// possible field information
			// current executing constraint, only set where needed
			_result = new QueryResultCandidates(this);
			_isTopLevel = isTopLevel;
			i_trans = a_trans;
			_classMetadata = a_classMetadata;
			_field = a_field;
			if (a_field == null || a_field._fieldMetadata == null || !(a_field._fieldMetadata
				.GetHandler() is StandardReferenceTypeHandler))
			{
				return;
			}
			ClassMetadata yc = ((StandardReferenceTypeHandler)a_field._fieldMetadata.GetHandler
				()).ClassMetadata();
			if (_classMetadata == null)
			{
				_classMetadata = yc;
			}
			else
			{
				yc = _classMetadata.GetHigherOrCommonHierarchy(yc);
				if (yc != null)
				{
					_classMetadata = yc;
				}
			}
		}
示例#4
0
 public WriteUpdateProcessor(LocalTransaction transaction, int id, ClassMetadata clazz
                             , ArrayType typeInfo)
 {
     _transaction = transaction;
     _id          = id;
     _clazz       = clazz;
     _typeInfo    = typeInfo;
 }
示例#5
0
		public WriteUpdateProcessor(LocalTransaction transaction, int id, ClassMetadata clazz
			, ArrayType typeInfo)
		{
			_transaction = transaction;
			_id = id;
			_clazz = clazz;
			_typeInfo = typeInfo;
		}
		public virtual void ReadIdentity(LocalTransaction trans)
		{
			LocalObjectContainer file = trans.LocalContainer();
			Db4oDatabase identity = Debug4.staticIdentity ? Db4oDatabase.StaticIdentity : (Db4oDatabase
				)file.GetByID(trans, SystemData().IdentityId());
			if (null != identity)
			{
				file.Activate(trans, identity, new FixedActivationDepth(2));
				SystemData().Identity(identity);
			}
		}
示例#7
0
		private void AddCommittedInfoMsg(CallbackObjectInfoCollections committedInfo, LocalTransaction
			 serverTransaction)
		{
			lock (ContainerLock())
			{
				Msg.CommittedInfo.SetTransaction(serverTransaction);
				MCommittedInfo message = Msg.CommittedInfo.Encode(committedInfo, ServerMessageDispatcher
					().DispatcherID());
				message.SetMessageDispatcher(ServerMessageDispatcher());
				ServerMessageDispatcher().Server().AddCommittedInfoMsg(message);
			}
		}
示例#8
0
            public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args)
            {
                LocalTransaction trans = (LocalTransaction)((CommitEventArgs)args).Transaction();
                long             transactionTimestamp = trans.Timestamp();
                long             commitTimestamp      = (transactionTimestamp > 0) ? transactionTimestamp : this._enclosing
                                                        ._container.GenerateTimeStampId();
                Transaction sysTrans = trans.SystemTransaction();

                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Added.GetEnumerator(), commitTimestamp
                                  );
                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Updated.GetEnumerator(), commitTimestamp
                                  );
                this.AddTimestamp(sysTrans, ((CommitEventArgs)args).Deleted.GetEnumerator(), 0);
            }
示例#9
0
        public void DropIndex(LocalTransaction systemTrans)
        {
            if (_index == null)
            {
                return;
            }
            ObjectContainerBase stream = systemTrans.Container();

            if (stream.ConfigImpl.MessageLevel() > Const4.None)
            {
                stream.Message("dropping index " + ToString());
            }
            _index.Free(systemTrans);
            stream.SetDirtyInSystemTransaction(ContainingClass());
            _index = null;
        }
		public virtual ByteArrayBuffer Marshall(LocalTransaction transaction, IIntIterator4
			 ids, int count)
		{
			ByteArrayBuffer buffer = new ByteArrayBuffer(Const4.IntLength + count * Const4.IntLength
				);
			int sizeOffset = buffer.Offset();
			buffer.WriteInt(0);
			int written = 0;
			while (count > 0 && ids.MoveNext())
			{
				buffer.WriteInt(ids.CurrentInt());
				++written;
				--count;
			}
			buffer.Seek(sizeOffset);
			buffer.WriteInt(written);
			return buffer;
		}
        /// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
        public override void AddFieldIndex(ObjectIdContextImpl context)
        {
            LocalTransaction     transaction    = (LocalTransaction)context.Transaction();
            LocalObjectContainer localContainer = (LocalObjectContainer)transaction.Container
                                                      ();
            Slot oldSlot                = transaction.IdSystem().CommittedSlot(context.ObjectId());
            int  savedOffset            = context.Offset();
            int  db4oDatabaseIdentityID = context.ReadInt();
            long uuid = context.ReadLong();

            context.Seek(savedOffset);
            bool isnew = (oldSlot.IsNull());

            if ((uuid == 0 || db4oDatabaseIdentityID == 0) && context.ObjectId() > 0 && !isnew)
            {
                UUIDFieldMetadata.DatabaseIdentityIDAndUUID identityAndUUID = ReadDatabaseIdentityIDAndUUID
                                                                                  (localContainer, context.ClassMetadata(), oldSlot, false);
                db4oDatabaseIdentityID = identityAndUUID.databaseIdentityID;
                uuid = identityAndUUID.uuid;
            }
            if (db4oDatabaseIdentityID == 0)
            {
                db4oDatabaseIdentityID = localContainer.Identity().GetID(transaction);
            }
            if (uuid == 0)
            {
                uuid = localContainer.GenerateTimeStampId();
            }
            StatefulBuffer writer = (StatefulBuffer)context.Buffer();

            writer.WriteInt(db4oDatabaseIdentityID);
            writer.WriteLong(uuid);
            if (isnew)
            {
                AddIndexEntry(writer, uuid);
            }
        }
示例#12
0
文件: BTree.cs 项目: erdincay/db4o
		public override void Free(LocalTransaction systemTrans)
		{
			_disposed = true;
			FreeAllNodeIds(systemTrans, AllNodeIds(systemTrans));
			base.Free((LocalTransaction)systemTrans);
		}
示例#13
0
		public override void Free(LocalTransaction trans)
		{
			_dead = true;
			if (!IsRoot())
			{
				Db4objects.Db4o.Internal.Btree.BTreeNode parent = _btree.ProduceNode(_parentID);
				parent.RemoveChild(trans, this);
			}
			PointPreviousTo(trans, _nextID);
			PointNextTo(trans, _previousID);
			base.Free((LocalTransaction)trans);
			_btree.RemoveNode(this);
			_btree.NotifyDeleted(trans, this);
		}
		public virtual ByteArrayBuffer Marshall(LocalTransaction transaction, IIntIterator4
			 ids, int maxCount)
		{
			return new EagerObjectWriter(_config, transaction).Write(ids, maxCount);
		}
示例#15
0
		/// <exception cref="System.Exception"></exception>
		public static void AssertAllSlotsFreed(LocalTransaction trans, BTree bTree, ICodeBlock
			 block)
		{
			LocalObjectContainer container = (LocalObjectContainer)trans.Container();
			ITransactionalIdSystem idSystem = trans.IdSystem();
			IEnumerator allSlotIDs = bTree.AllNodeIds(trans.SystemTransaction());
			Collection4 allSlots = new Collection4();
			while (allSlotIDs.MoveNext())
			{
				int slotID = ((int)allSlotIDs.Current);
				Slot slot = idSystem.CurrentSlot(slotID);
				allSlots.Add(slot);
			}
			Slot bTreeSlot = idSystem.CurrentSlot(bTree.GetID());
			allSlots.Add(bTreeSlot);
			Collection4 freedSlots = new Collection4();
			IFreespaceManager freespaceManager = container.FreespaceManager();
			container.InstallDebugFreespaceManager(new FreespaceManagerForDebug(new _ISlotListener_99
				(freedSlots)));
			block.Run();
			container.InstallDebugFreespaceManager(freespaceManager);
			Assert.IsTrue(freedSlots.ContainsAll(allSlots.GetEnumerator()));
		}
示例#16
0
		public StandardSlotAccessor(LocalTransaction transaction)
		{
			_transaction = transaction;
		}
示例#17
0
 public virtual void Free(LocalTransaction trans)
 {
     IdSystem(trans.SystemTransaction()).NotifySlotDeleted(GetID(), SlotChangeFactory(
                                                               ));
 }
示例#18
0
 public _IVisitor4_224(LocalTransaction _enclosing)
 {
     this._enclosing = _enclosing;
 }
示例#19
0
 public _ICommittedCallbackDispatcher_39(LocalTransaction _enclosing)
 {
     this._enclosing = _enclosing;
 }
		public SodaQueryComparator(LocalObjectContainer container, ClassMetadata extent, 
			SodaQueryComparator.Ordering[] orderings)
		{
			_container = container;
			_transaction = ((LocalTransaction)_container.Transaction);
			_extentType = extent;
			_orderings = orderings;
			ResolveFieldPaths(orderings);
		}
示例#21
0
 public _ICallbackInfoCollector_274(LocalTransaction _enclosing, Collection4 deleted
                                    )
 {
     this._enclosing = _enclosing;
     this.deleted    = deleted;
 }
示例#22
0
文件: BTree.cs 项目: erdincay/db4o
		private void FreeAllNodeIds(LocalTransaction systemTrans, IEnumerator allNodeIDs)
		{
			ITransactionalIdSystem idSystem = IdSystem(systemTrans);
			while (allNodeIDs.MoveNext())
			{
				int id = ((int)allNodeIDs.Current);
				idSystem.NotifySlotDeleted(id, SlotChangeFactory());
			}
		}
示例#23
0
			public _IVisitor4_336(DefragmentServicesImpl _enclosing, CommitTimestampSupport target
				, LocalTransaction targetTransaction)
			{
				this._enclosing = _enclosing;
				this.target = target;
				this.targetTransaction = targetTransaction;
			}
		public EagerObjectWriter(ObjectExchangeConfiguration config, LocalTransaction transaction
			)
		{
			_config = config;
			_transaction = transaction;
		}
		public void DropIndex(LocalTransaction systemTrans)
		{
			if (_index == null)
			{
				return;
			}
			ObjectContainerBase stream = systemTrans.Container();
			if (stream.ConfigImpl.MessageLevel() > Const4.None)
			{
				stream.Message("dropping index " + ToString());
			}
			_index.Free(systemTrans);
			stream.SetDirtyInSystemTransaction(ContainingClass());
			_index = null;
		}
示例#26
0
 public _ICallbackInfoCollector_320(LocalTransaction _enclosing, Collection4 added
     , Collection4 updated, Collection4 deleted)
 {
     this._enclosing = _enclosing;
     this.added = added;
     this.updated = updated;
     this.deleted = deleted;
 }
示例#27
0
 public _IVisitor4_224(LocalTransaction _enclosing)
 {
     this._enclosing = _enclosing;
 }
示例#28
0
		public virtual void Free(LocalTransaction trans)
		{
			IdSystem(trans.SystemTransaction()).NotifySlotDeleted(GetID(), SlotChangeFactory(
				));
		}
示例#29
0
 public _ICallbackInfoCollector_274(LocalTransaction _enclosing, Collection4 deleted
     )
 {
     this._enclosing = _enclosing;
     this.deleted = deleted;
 }
示例#30
0
 public _ICommittedCallbackDispatcher_39(LocalTransaction _enclosing)
 {
     this._enclosing = _enclosing;
 }