当前位置: 首页>>代码示例>>C#>>正文


C# Transaction.Container方法代码示例

本文整理汇总了C#中Db4objects.Db4o.Internal.Transaction.Container方法的典型用法代码示例。如果您正苦于以下问题:C# Transaction.Container方法的具体用法?C# Transaction.Container怎么用?C# Transaction.Container使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Db4objects.Db4o.Internal.Transaction的用法示例。


在下文中一共展示了Transaction.Container方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ForID

		public static Db4objects.Db4o.Internal.Marshall.CollectIdContext ForID(Transaction
			 transaction, IdObjectCollector collector, int id)
		{
			StatefulBuffer reader = transaction.Container().ReadStatefulBufferById(transaction
				, id);
			if (reader == null)
			{
				return null;
			}
			ObjectHeader oh = new ObjectHeader(transaction.Container(), reader);
			return new Db4objects.Db4o.Internal.Marshall.CollectIdContext(transaction, collector
				, oh, reader);
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:13,代码来源:CollectIdContext.cs

示例2: QConClass

		internal QConClass(Transaction a_trans, QCon a_parent, QField a_field, IReflectClass
			 claxx) : base(a_trans, a_parent, a_field, null)
		{
			// C/S
			if (claxx != null)
			{
				_classMetadata = a_trans.Container().ProduceClassMetadata(claxx);
				if (claxx.Equals(a_trans.Container()._handlers.IclassObject))
				{
					_classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
				}
			}
			_claxx = claxx;
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:14,代码来源:QConClass.cs

示例3: Dispatch

			public virtual bool Dispatch(Transaction trans, object obj, int eventID)
			{
				if (methods[eventID] == null)
				{
					return true;
				}
				object[] parameters = new object[] { trans.ObjectContainer() };
				ObjectContainerBase container = trans.Container();
				int stackDepth = container.StackDepth();
				int topLevelCallId = container.TopLevelCallId();
				container.StackDepth(0);
				try
				{
					object res = methods[eventID].Invoke(obj, parameters);
					if (res is bool)
					{
						return ((bool)res);
					}
				}
				finally
				{
					container.StackDepth(stackDepth);
					container.TopLevelCallId(topLevelCallId);
				}
				return true;
			}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:26,代码来源:EventDispatchers.cs

示例4: InitOnUp

		public virtual void InitOnUp(Transaction systemTrans, FieldMetadata fieldMetadata
			)
		{
			ObjectContainerBase anyStream = systemTrans.Container();
			if (!anyStream.MaintainsIndices())
			{
				return;
			}
			if (!fieldMetadata.SupportsIndex())
			{
				Indexed(false);
			}
			TernaryBool indexedFlag = _config.GetAsTernaryBool(IndexedKey);
			if (indexedFlag.DefiniteNo())
			{
				fieldMetadata.DropIndex((LocalTransaction)systemTrans);
				return;
			}
			if (UseExistingIndex(systemTrans, fieldMetadata))
			{
				return;
			}
			if (!indexedFlag.DefiniteYes())
			{
				return;
			}
			fieldMetadata.CreateIndex();
		}
开发者ID:Galigator,项目名称:db4o,代码行数:28,代码来源:Config4Field.cs

示例5: QConClass

		internal QConClass(Transaction trans, QCon parent, QField field, IReflectClass claxx
			) : base(trans, parent, field, null)
		{
			// C/S
			if (claxx != null)
			{
				ObjectContainerBase container = trans.Container();
				_classMetadata = container.ClassMetadataForReflectClass(claxx);
				if (_classMetadata == null)
				{
					// could be an aliased class, try to resolve.
					string className = claxx.GetName();
					string aliasRunTimeName = container.Config().ResolveAliasStoredName(className);
					if (!className.Equals(aliasRunTimeName))
					{
						_classMetadata = container.ClassMetadataForName(aliasRunTimeName);
					}
				}
				if (claxx.Equals(container._handlers.IclassObject))
				{
					_classMetadata = (ClassMetadata)_classMetadata.TypeHandler();
				}
			}
			_claxx = claxx;
		}
开发者ID:erdincay,项目名称:db4o,代码行数:25,代码来源:QConClass.cs

示例6: SetTransaction

		public virtual void SetTransaction(Transaction trans)
		{
			if (trans != null)
			{
				_trans = trans;
				_stream = trans.Container();
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:8,代码来源:KnownClassesRepository.cs

示例7: Marshall

		public static StatefulBuffer Marshall(Transaction ta, object obj)
		{
			SerializedGraph serialized = Marshall(ta.Container(), obj);
			StatefulBuffer buffer = new StatefulBuffer(ta, serialized.Length());
			buffer.Append(serialized._bytes);
			buffer.UseSlot(serialized._id, 0, serialized.Length());
			return buffer;
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:8,代码来源:Serializer.cs

示例8: ReadBufferById

 protected override ByteArrayBuffer ReadBufferById(Transaction trans)
 {
     var slot = IdSystem(trans).CurrentSlot(GetID());
     if (DTrace.enabled)
     {
         DTrace.SlotRead.LogLength(GetID(), slot);
     }
     return ((LocalObjectContainer) trans.Container()).ReadBufferBySlot(slot);
 }
开发者ID:masroore,项目名称:db4o,代码行数:9,代码来源:LocalPersistentBase.cs

示例9: BeginReplication

		public static Db4objects.Drs.Db4o.ReplicationRecord BeginReplication(Transaction 
			transA, Transaction transB)
		{
			ObjectContainerBase peerA = transA.Container();
			ObjectContainerBase peerB = transB.Container();
			Db4oDatabase dbA = ((IInternalObjectContainer)peerA).Identity();
			Db4oDatabase dbB = ((IInternalObjectContainer)peerB).Identity();
			dbB.Bind(transA);
			dbA.Bind(transB);
			Db4oDatabase younger = null;
			Db4oDatabase older = null;
			if (dbA.IsOlderThan(dbB))
			{
				younger = dbB;
				older = dbA;
			}
			else
			{
				younger = dbA;
				older = dbB;
			}
			Db4objects.Drs.Db4o.ReplicationRecord rrA = QueryForReplicationRecord(peerA, transA
				, younger, older);
			Db4objects.Drs.Db4o.ReplicationRecord rrB = QueryForReplicationRecord(peerB, transB
				, younger, older);
			if (rrA == null)
			{
				if (rrB == null)
				{
					return new Db4objects.Drs.Db4o.ReplicationRecord(younger, older);
				}
				rrB.Store(peerA);
				return rrB;
			}
			if (rrB == null)
			{
				rrA.Store(peerB);
				return rrA;
			}
			if (rrA != rrB)
			{
				peerB.ShowInternalClasses(true);
				try
				{
					int id = peerB.GetID(transB, rrB);
					peerB.Bind(transB, rrA, id);
				}
				finally
				{
					peerB.ShowInternalClasses(false);
				}
			}
			return rrA;
		}
开发者ID:Galigator,项目名称:db4o,代码行数:54,代码来源:ReplicationRecord.cs

示例10: ReadSpec

		public virtual RawClassSpec ReadSpec(Transaction trans, ByteArrayBuffer reader)
		{
			byte[] nameBytes = ReadName(trans, reader);
			string className = trans.Container().StringIO().Read(nameBytes);
			ReadMetaClassID(reader);
			// skip
			int ancestorID = reader.ReadInt();
			reader.IncrementOffset(Const4.IntLength);
			// index ID
			int numFields = reader.ReadInt();
			return new RawClassSpec(className, ancestorID, numFields);
		}
开发者ID:erdincay,项目名称:db4o,代码行数:12,代码来源:ClassMarshaller.cs

示例11: PeekPersisted

		public static Db4objects.Db4o.Internal.HardObjectReference PeekPersisted(Transaction
			 trans, int id, int depth)
		{
			object obj = trans.Container().PeekPersisted(trans, id, ActivationDepthProvider(trans
				).ActivationDepth(depth, ActivationMode.Peek), true);
			if (obj == null)
			{
				return null;
			}
			ObjectReference @ref = trans.ReferenceForId(id);
			return new Db4objects.Db4o.Internal.HardObjectReference(@ref, obj);
		}
开发者ID:Orvid,项目名称:SQLInterfaceCollection,代码行数:12,代码来源:HardObjectReference.cs

示例12: Store

		public virtual void Store(Transaction trans)
		{
			ObjectContainerBase container = trans.Container();
			container.ShowInternalClasses(true);
			try
			{
				container.StoreAfterReplication(trans, this, container.UpdateDepthProvider().ForDepth
					(int.MaxValue), false);
			}
			finally
			{
				container.ShowInternalClasses(false);
			}
		}
开发者ID:Galigator,项目名称:db4o,代码行数:14,代码来源:ReplicationRecord.cs

示例13: Marshall

		internal override void Marshall(Transaction trans, ObjectReference @ref, IWriteBuffer
			 buffer, bool isMigrating, bool isNew)
		{
			VirtualAttributes attr = @ref.VirtualAttributes();
			if (!isMigrating)
			{
				attr.i_version = trans.Container().GenerateTimeStampId();
			}
			if (attr == null)
			{
				buffer.WriteLong(0);
			}
			else
			{
				buffer.WriteLong(attr.i_version);
			}
		}
开发者ID:superyfwy,项目名称:db4o,代码行数:17,代码来源:VersionFieldMetadata.cs

示例14: AssociateYapClass

		private void AssociateYapClass(Transaction a_trans, object a_object)
		{
			if (a_object == null)
			{
			}
			else
			{
				//It seems that we need not result the following field
				//i_object = null;
				//i_comparator = Null.INSTANCE;
				//i_classMetadata = null;
				// FIXME: Setting the YapClass to null will prevent index use
				// If the field is typed we can guess the right one with the
				// following line. However this does break some SODA test cases.
				// Revisit!
				//            if(i_field != null){
				//                i_classMetadata = i_field.getYapClass();
				//            }
				_classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject
					(a_object));
				if (_classMetadata != null)
				{
					i_object = _classMetadata.GetComparableObject(a_object);
					if (a_object != i_object)
					{
						i_attributeProvider = _classMetadata.Config().QueryAttributeProvider();
						_classMetadata = a_trans.Container().ProduceClassMetadata(a_trans.Reflector().ForObject
							(i_object));
					}
					if (_classMetadata != null)
					{
						_classMetadata.CollectConstraints(a_trans, this, i_object, new _IVisitor4_84(this
							));
					}
					else
					{
						AssociateYapClass(a_trans, null);
					}
				}
				else
				{
					AssociateYapClass(a_trans, null);
				}
			}
		}
开发者ID:bvangrinsven,项目名称:db4o-net,代码行数:45,代码来源:QConObject.cs

示例15: StoreAndGetId

		private int StoreAndGetId(Transaction trans)
		{
			ObjectContainerBase stream = trans.Container();
			stream.ShowInternalClasses(true);
			try
			{
				stream.Store2(trans, this, stream.UpdateDepthProvider().ForDepth(2), false);
				return stream.GetID(trans, this);
			}
			finally
			{
				stream.ShowInternalClasses(false);
			}
		}
开发者ID:erdincay,项目名称:db4o,代码行数:14,代码来源:Db4oDatabase.cs


注:本文中的Db4objects.Db4o.Internal.Transaction.Container方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。