public void ProcessAtServer() { int classMetadataID = _payLoad.ReadInt(); int arrayTypeValue = _payLoad.ReadInt(); ArrayType arrayType = ArrayType.ForValue(arrayTypeValue); Unmarshall(_payLoad._offset); lock (ContainerLock()) { ClassMetadata classMetadata = LocalContainer().ClassMetadataForID(classMetadataID ); int id = _payLoad.GetID(); Transaction().DontDelete(id); Slot clientSlot = _payLoad.Slot(); Slot newSlot = null; if (clientSlot.IsUpdate()) { Transaction().WriteUpdateAdjustIndexes(id, classMetadata, arrayType); newSlot = LocalContainer().AllocateSlotForUserObjectUpdate(_payLoad.Transaction() , _payLoad.GetID(), _payLoad.Length()); } else { if (clientSlot.IsNew()) { // Just one known usecase for this one: For updating plain objects from old versions, since // they didnt't have own slots that could be freed. // Logic that got us here in OpenTypeHandler7#addReference()#writeUpdate() newSlot = LocalContainer().AllocateSlotForNewUserObject(_payLoad.Transaction(), _payLoad .GetID(), _payLoad.Length()); } else { throw new InvalidOperationException(); } } _payLoad.Address(newSlot.Address()); classMetadata.AddFieldIndices(_payLoad); _payLoad.WriteEncrypt(); DeactivateCacheFor(id); } }
public void ProcessAtServer() { int classMetadataId = _payLoad.ReadInt(); Unmarshall(_payLoad._offset); lock (ContainerLock()) { ClassMetadata classMetadata = classMetadataId == 0 ? null : LocalContainer().ClassMetadataForID (classMetadataId); int id = _payLoad.GetID(); Transaction().IdSystem().PrefetchedIDConsumed(id); Slot slot = LocalContainer().AllocateSlotForNewUserObject(Transaction(), id, _payLoad .Length()); _payLoad.Address(slot.Address()); if (classMetadata != null) { classMetadata.AddFieldIndices(_payLoad); } LocalContainer().WriteNew(Transaction(), _payLoad.Pointer(), classMetadata, _payLoad ); } }