本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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();
}
示例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;
}
示例6: SetTransaction
public virtual void SetTransaction(Transaction trans)
{
if (trans != null)
{
_trans = trans;
_stream = trans.Container();
}
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
}
示例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);
}
}