Bug #9274
Analyze how creatingBuffer is relevant after the introduction of multiplyReferenced DMOs
0%
History
#1 Updated by Alexandru Lungu over 1 year ago
This task is about the relevance of RecordBuffer.creatingBuffer.
Recently, FWD added support for multiplyReferenced DMOs, that are DMOs referenced by multiple buffers at the same time. The idea here is that a buffer that runs out of scope may not flush the DMO if it is multiply referenced. This breaks an invariant used in the design of creatingBuffer (aka there is only one buffer that is responsible of a transient record). In fact, the creatingBuffer can become unavailable, because after creation, the DMO can be loaded in another buffer and the OG creating buffer run out of scope. This basically means that the creatingBuffer will become unavailable and much logic related to RecordBuffer.creatingBuffer doesn't consider that.
Although the concept is flawed by design, I think we can resurrect this creatingBuffer by switching it to an arbitrary buffer that still holds that record. My idea is that a RecordNuffer.getCreatingBuffer should be used to resolute either the "cached" creatingBuffer, or if it is unavailable, look-up for another buffer that has the exact same DMO already loaded and presume it is the "creating buffer". In short words: automatically switch the "creating buffer" if needed.
The issue derived from #9050, where the RecordNursery is incorrectly caching the DMO with its creating buffer, unkowning that the creating buffer can become unavailable. In that case, the DMO still should have been flushed/registered to the dirty database if multiply-referenced.
RecordBuffershould use a.getCreatingBufferlogic that does the automatic look-upRecordNursery- #9050 WIPDirtyShareContext- not very relevant if they keep referencing a stale buffer - we need just the DMOBufIface and multiplex to reckon what persistence do we actually need. These two classes do not require internal logic with buffers; is just a place we make such mapping and the consumer (which is usually the Record Buffer) should resolute the buffer better.
Further insights on creatingBuffer are much appreciated.