Skip to content

Multiple calls to storer.store(...) #626

Answered by hg-ms
sare3th asked this question in Q&A
Discussion options

You must be logged in to vote

Hello,
The described behavior is intended.
In your example the first store of the devices will also store the new device object with version being null. The second store will recognize that the device objects has been processed already by the first store and ignore it.
In general, storer only process objects the first time they are encountered. Calling “commit” resets the storer after peristsing the data.

To update the object, you have two options:

  1. Call “commit” after the first store.
  2. Do the store after the last modification of the Device object.

In the example code there is also another thing to be aware of:
When setting the storage root at the beginning any existing root will be repla…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@sare3th
Comment options

Answer selected by sare3th
Comment options

You must be logged in to vote
2 replies
@hg-ms
Comment options

hg-ms Aug 11, 2023
Collaborator

@guykatz
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants