本文整理汇总了C#中Db4objects.Db4o.Internal.LocalObjectContainer.SystemTransaction方法的典型用法代码示例。如果您正苦于以下问题:C# LocalObjectContainer.SystemTransaction方法的具体用法?C# LocalObjectContainer.SystemTransaction怎么用?C# LocalObjectContainer.SystemTransaction使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Db4objects.Db4o.Internal.LocalObjectContainer
的用法示例。
在下文中一共展示了LocalObjectContainer.SystemTransaction方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AssertSingleEntry
public virtual void AssertSingleEntry(LocalObjectContainer container, long id)
{
var called = new BooleanByRef();
Index(container).TraverseKeys(container.SystemTransaction(), new _IVisitor4_24(id
, called));
Assert.IsTrue(called.value);
}
示例2: RebuildIndexForObject
/// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
protected virtual void RebuildIndexForObject(LocalObjectContainer container, int
objectId)
{
StatefulBuffer writer = container.ReadStatefulBufferById(container.SystemTransaction
(), objectId);
if (writer != null)
{
RebuildIndexForWriter(container, writer, objectId);
}
}
示例3: RebuildIndexForWriter
protected virtual void RebuildIndexForWriter(LocalObjectContainer container, StatefulBuffer
buffer, int objectId)
{
ObjectHeader objectHeader = new ObjectHeader(container, buffer);
ObjectIdContextImpl context = new ObjectIdContextImpl(container.SystemTransaction
(), buffer, objectHeader, objectId);
ClassMetadata classMetadata = context.ClassMetadata();
if (classMetadata.IsStruct())
{
// We don't keep version information for structs.
return;
}
if (classMetadata.SeekToField(container.SystemTransaction(), buffer, versionFieldMetadata
) != HandlerVersion.Invalid)
{
long version = ((long)versionFieldMetadata.Read(context));
if (version != 0)
{
LocalTransaction t = (LocalTransaction)container.SystemTransaction();
t.CommitTimestampSupport().Put(container.SystemTransaction(), objectId, version);
}
}
}
示例4: TypesFor
public static IDictionary TypesFor(LocalObjectContainer db, Sharpen.Util.ISet ids
)
{
IDictionary id2clazzes = new Hashtable();
ClassMetadataIterator iter = db.ClassCollection().Iterator();
while (iter.MoveNext())
{
for (IEnumerator idIter = ids.GetEnumerator(); idIter.MoveNext(); )
{
int id = ((int)idIter.Current);
ClassMetadata clazz = iter.CurrentClass();
BTree btree = BTreeClassIndexStrategy.Btree(clazz);
if (btree.Search(db.SystemTransaction(), id) != null)
{
Sharpen.Util.ISet clazzes = ((Sharpen.Util.ISet)id2clazzes[id]);
if (clazzes == null)
{
clazzes = new HashSet();
id2clazzes[id] = clazzes;
}
clazzes.Add(clazz);
}
}
}
IDictionary id2clazz = new Hashtable();
for (IEnumerator idIter = id2clazzes.Keys.GetEnumerator(); idIter.MoveNext(); )
{
int id = ((int)idIter.Current);
Sharpen.Util.ISet clazzes = ((Sharpen.Util.ISet)id2clazzes[id]);
ClassMetadata mostSpecific = null;
for (IEnumerator curClazzIter = clazzes.GetEnumerator(); curClazzIter.MoveNext(); )
{
ClassMetadata curClazz = ((ClassMetadata)curClazzIter.Current);
for (IEnumerator cmpClazzIter = clazzes.GetEnumerator(); cmpClazzIter.MoveNext(); )
{
ClassMetadata cmpClazz = ((ClassMetadata)cmpClazzIter.Current);
if (curClazz.Equals(cmpClazz._ancestor))
{
goto OUTER_continue;
}
}
mostSpecific = curClazz;
break;
OUTER_continue: ;
}
OUTER_break: ;
id2clazz[id] = mostSpecific;
}
return id2clazz;
}
示例5: Convert
public virtual void Convert(LocalObjectContainer container, int classIndexId, BTree
bTree)
{
Transaction trans = container.SystemTransaction();
ByteArrayBuffer reader = container.ReadBufferById(trans, classIndexId);
if (reader == null)
{
return;
}
int entries = reader.ReadInt();
for (int i = 0; i < entries; i++)
{
bTree.Add(trans, reader.ReadInt());
}
}
示例6: ReadIdentity
public override void ReadIdentity(LocalObjectContainer container)
{
_variablePart.ReadIdentity((LocalTransaction)container.SystemTransaction());
}
示例7: SlotEntryToZeroes
internal static void SlotEntryToZeroes(LocalObjectContainer file, int address)
{
StatefulBuffer writer = new StatefulBuffer(file.SystemTransaction(), address, SlotLength
());
for (int i = 0; i < IntsInSlot; i++)
{
writer.WriteInt(0);
}
writer.WriteEncrypt();
}
示例8: Reindex
private void Reindex(LocalObjectContainer container)
{
ClassMetadata clazz = ContainingClass();
if (RebuildIndexForClass(container, clazz))
{
container.SystemTransaction().Commit();
}
}
示例9: RebuildIndexForWriter
protected virtual void RebuildIndexForWriter(LocalObjectContainer stream, StatefulBuffer
writer, int objectId)
{
ObjectHeader oh = new ObjectHeader(stream, writer);
object obj = ReadIndexEntryForRebuild(writer, oh);
AddIndexEntry(stream.SystemTransaction(), objectId, obj);
}
示例10: RebuildIndexForObject
/// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
protected virtual void RebuildIndexForObject(LocalObjectContainer stream, ClassMetadata
classMetadata, int objectId)
{
StatefulBuffer writer = stream.ReadStatefulBufferById(stream.SystemTransaction(),
objectId);
if (writer != null)
{
RebuildIndexForWriter(stream, writer, objectId);
}
}
示例11: BTreeUsage
internal static long BTreeUsage(LocalObjectContainer db, BTree btree, ISlotMap slotMap
)
{
return BTreeUsage(db.SystemTransaction(), db.IdSystem(), btree, slotMap);
}
示例12: RebuildIndexForObject
/// <exception cref="Db4objects.Db4o.Internal.FieldIndexException"></exception>
protected override void RebuildIndexForObject(LocalObjectContainer container, ClassMetadata
classMetadata, int objectId)
{
var slot = container.SystemTransaction().IdSystem().CurrentSlot(objectId);
var data = ReadDatabaseIdentityIDAndUUID(
container, classMetadata, slot, true);
if (null == data)
{
return;
}
AddIndexEntry(container.LocalSystemTransaction(), objectId, data.uuid);
}