private object ObjectFor(Transaction trans, IObjectInfo info) { int id = (int)info.GetInternalID(); HardObjectReference @ref = HardObjectReference.PeekPersisted(trans, id, 1); return(@ref._object); }
public void OnEvent(object sender, Db4objects.Db4o.Events.CommitEventArgs args) { lock (this._enclosing._updatesMonitor) { Transaction trans = ((IInternalObjectContainer)client).Transaction; IObjectInfoCollection updated = ((CommitEventArgs)args).Updated; IEnumerator infos = updated.GetEnumerator(); while (infos.MoveNext()) { IObjectInfo info = (IObjectInfo)infos.Current; object obj = trans.ObjectForIdFromCache((int)info.GetInternalID()); if (obj == null) { continue; } // DEPTH may need to be 2 for member collections // to be updated also. client.Refresh(obj, 1); } if (this._enclosing.IsNetworkingCS()) { Sharpen.Runtime.NotifyAll(this._enclosing._updatesMonitor); } } }
public void Encode(ByteArrayOutputStream os, IObjectInfo info) { PrimitiveCodec.WriteLong(os, info.GetInternalID()); long sourceDatabaseId = ((FrozenObjectInfo)info).SourceDatabaseId(this._enclosing .Transaction()); PrimitiveCodec.WriteLong(os, sourceDatabaseId); PrimitiveCodec.WriteLong(os, ((FrozenObjectInfo)info).UuidLongPart()); PrimitiveCodec.WriteLong(os, info.GetCommitTimestamp()); }
private void AssertInfosAreConsistent(long[] ids, IObjectInfo[] infos) { for (int i = 0; i < infos.Length; i++) { IObjectInfo info = Db().GetObjectInfo(Db().GetByID(ids[i])); Assert.AreEqual(info.GetInternalID(), infos[i].GetInternalID()); Assert.AreEqual(info.GetUUID().GetLongPart(), infos[i].GetUUID().GetLongPart()); Assert.AreSame(info.GetObject(), infos[i].GetObject()); } }
public long GetLocalID() { try { IObjectInfo objInfo = Db4oClient.Client.Ext().GetObjectInfo(m_genObject); return(objInfo != null?objInfo.GetInternalID() : 0); } catch (Exception oEx) { LoggingHelper.HandleException(oEx); return(0); } }
private void AddTimestamp(Transaction trans, IEnumerator it, long commitTimestamp ) { while (it.MoveNext()) { IObjectInfo objInfo = (IObjectInfo)it.Current; CommitTimestampSupport.TimestampEntry te = new CommitTimestampSupport.TimestampEntry ((int)objInfo.GetInternalID(), commitTimestamp); CommitTimestampSupport.TimestampEntry oldEntry = (CommitTimestampSupport.TimestampEntry ) this._enclosing._idToTimestamp.Remove(trans, te); if (oldEntry != null) { this._enclosing._timestampToId.Remove(trans, oldEntry); } if (commitTimestamp != 0) { this._enclosing._idToTimestamp.Add(trans, te); this._enclosing._timestampToId.Add(trans, te); } } }
public void Encode(ByteArrayOutputStream os, IObjectInfo info) { PrimitiveCodec.WriteLong(os, info.GetInternalID()); }
private object ObjectFor(Transaction trans, IObjectInfo info) { int id = (int)info.GetInternalID(); HardObjectReference @ref = HardObjectReference.PeekPersisted(trans, id, 1); return @ref._object; }