本文整理汇总了C#中NeoDatis.SetNextObjectOID方法的典型用法代码示例。如果您正苦于以下问题:C# NeoDatis.SetNextObjectOID方法的具体用法?C# NeoDatis.SetNextObjectOID怎么用?C# NeoDatis.SetNextObjectOID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类NeoDatis
的用法示例。
在下文中一共展示了NeoDatis.SetNextObjectOID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateNonNativeObjectInfo
//.........这里部分代码省略.........
}
}
// If we reach this update, In Place Update was not possible. Do a
// normal update. Deletes the
// current object and creates a new one
if (oldMetaRepresentation == null && withIndex)
{
// We must load old meta representation to be able to compute
// old index key to update index
oldMetaRepresentation = objectReader.ReadNonNativeObjectInfoFromPosition(null, oid
, currentPosition, false, false);
}
nbNormalUpdates++;
if (hasObject)
{
cache.StartInsertingObjectWithOid(@object, oid, nnoi);
}
// gets class info from in memory meta model
NeoDatis.Odb.Core.Layers.Layer2.Meta.ClassInfo ci = lsession.GetMetaModel().GetClassInfoFromId
(lastHeader.GetClassInfoId());
if (hasObject)
{
// removes the object from the cache
// cache.removeObjectWithOid(oid, object);
cache.EndInsertingObject(@object);
}
NeoDatis.Odb.OID previousObjectOID = lastHeader.GetPreviousObjectOID();
NeoDatis.Odb.OID nextObjectOid = lastHeader.GetNextObjectOID();
if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
{
NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "Updating object " + nnoi.ToString(
));
NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "position = " + currentPosition +
" | prev instance = " + previousObjectOID + " | next instance = " + nextObjectOid
);
}
nnoi.SetPreviousInstanceOID(previousObjectOID);
nnoi.SetNextObjectOID(nextObjectOid);
// Mark the block of current object as deleted
MarkAsDeleted(currentPosition, oid, objectIsInConnectedZone);
// Creates the new object
oid = InsertNonNativeObject(oid, nnoi, false);
// This position after write must be call just after the insert!!
long positionAfterWrite = fsi.GetPosition();
if (hasObject)
{
// update cache
cache.AddObject(oid, @object, nnoi.GetHeader());
}
//TODO check if we must update cross session cache
fsi.SetWritePosition(positionAfterWrite, true);
long nbConnectedObjectsAfter = nnoi.GetClassInfo().GetCommitedZoneInfo().GetNbObjects
();
long nbNonConnectedObjectsAfter = nnoi.GetClassInfo().GetUncommittedZoneInfo().GetNbObjects
();
if (nbConnectedObjectsAfter != nbConnectedObjects || nbNonConnectedObjectsAfter !=
nbNonConnectedObjects)
{
}
// TODO check this
// throw new
// ODBRuntimeException(Error.INTERNAL_ERROR.addParameter("Error
// in nb connected/unconnected counter"));
return oid;
}
catch (System.Exception e)
{
message = DepthToSpaces() + "Error updating object " + nnoi.ToString() + " : " +
NeoDatis.Tool.Wrappers.OdbString.ExceptionToString(e, true);
NeoDatis.Tool.DLogger.Error(message);
throw new NeoDatis.Odb.ODBRuntimeException(e, message);
}
finally
{
if (objectHasChanged)
{
if (withIndex)
{
ManageIndexesForUpdate(oid, nnoi, oldMetaRepresentation);
}
// triggers,FIXME passing null to old object representation
// (oldMetaRepresentation may be null)
if (hasObject)
{
storageEngine.GetTriggerManager().ManageUpdateTriggerAfter(nnoi.GetClassInfo().GetFullClassName
(), oldMetaRepresentation, @object, oid);
}
else
{
storageEngine.GetTriggerManager().ManageUpdateTriggerAfter(nnoi.GetClassInfo().GetFullClassName
(), oldMetaRepresentation, nnoi, oid);
}
}
if (NeoDatis.Odb.OdbConfiguration.IsDebugEnabled(LogId))
{
NeoDatis.Tool.DLogger.Debug(DepthToSpaces() + "end updating object with oid=" + oid
+ " at pos " + nnoi.GetPosition() + " => " + nnoi.ToString());
}
}
}