You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In general we detach a document in the load() and getDocumentsByQuery() method. This is for performance reasons and the fact, that a ItemCollection can hold byte arrays which will be copied by reference.
Problem:
In cases where these methods are called after a document was saved - save() method - in one single transaction, the detach call will discard the changes made to the document before in the save() method.
Solution:
For that reason we need to mark a managed document entity in the save() method, so that the methods load() and getDocumentsByQuery() can evaluate this flag. Depending on the state, the methods can decide the correct behavior.
In case a document is not flagged (not saved during same transaction), we can still detach the loaded entity
In case a document is flagged (saved during save transaction) we may not detach it, but make a deepCopy (clone) of the document instance.
This will avoid the effect, that data written to a document get lost in a long running transaction with save and load calls.
The text was updated successfully, but these errors were encountered:
In general we detach a document in the load() and getDocumentsByQuery() method. This is for performance reasons and the fact, that a ItemCollection can hold byte arrays which will be copied by reference.
Problem:
In cases where these methods are called after a document was saved - save() method - in one single transaction, the detach call will discard the changes made to the document before in the save() method.
Solution:
For that reason we need to mark a managed document entity in the save() method, so that the methods load() and getDocumentsByQuery() can evaluate this flag. Depending on the state, the methods can decide the correct behavior.
This will avoid the effect, that data written to a document get lost in a long running transaction with save and load calls.
The text was updated successfully, but these errors were encountered: