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
I have spent hours scouring the web and eclipsestore website looking for answers to a fundamental question about EclipseStore: what are the rules about using eclipseStore from multiple threads?
But then this: #69 (comment)
says that you can safely read/modifydifferent parts of the object graph if they do not
reference each other, and that the basic rule is to avoid modifying data that
eclipsestore is in the process of saving.
(1) Can multiple threads issue overlapping store() requests? Which of the store() variants are safe to do so?
What about concurrent load() and store() requests?
(2) Can I load/store different parts of the object graph in overlapping multiple threads if they dont reference each other?
(3) can multiple threads load the same part of the object graph concurrently?
(4) when a thread issues a store(), is the store() complete when the function returns or is the work done in
background threads. This is relevant when the programmer wants to avoid modifying data while eclipseStore
is storing it.
(5) what other concurrency considerations can you share?
The serialized data is written to the storage target.
It’s important to keep in mind that, if an object is persisted more than once (e.g. after updating a value) the last written version of that object is considered as the actual (latest) version when loading.
the store method returns when all data is collected
the commit methods returns after the data is written
Please be aware that there are two different implementations of the Storer which differ how they collect the data to be persisted. See Lazy and Eager Storing.
If multithreading you need to ensure that the commits are executed in the correct order!
Loading data
When the storage manager is started it will load all data into memory except those behind Lazy References. See lazy loading.
If data needs to be loaded lazy the necessary synchronization is done by Eclipse Store.
Concurrency
Eclipse Store does not own the object graph that is persisted. It is owned by the application! Therefore, it is important that the application takes care of synchronization if multithreading is done while Eclipse Store reads that graph during store operations. It must not happen that the graph is modified by another thread while Eclipse Store collects the graphs data to persist it.
As Example you may think of two threads that add items to a collection and then store the collection.
It must not happen that one of the threads adds an item to the collection while a store call reads form this collection to collect the data to be persisted.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have spent hours scouring the web and eclipsestore website looking for answers to a fundamental question about EclipseStore: what are the rules about using eclipseStore from multiple threads?
Basically I have only found this:
https://docs.eclipsestore.io/manual/storage/root-instances.html
which says that you have to serialize all access (reading and writing) to your
objects managed by eclipseStore.
But then this:
#69 (comment)
says that you can safely read/modifydifferent parts of the object graph if they do not
reference each other, and that the basic rule is to avoid modifying data that
eclipsestore is in the process of saving.
and this in the documentation:
https://docs.eclipsestore.io/manual/storage/faq/file-storage.html
which says that only one process may access the persistent data at a time,
https://docs.eclipsestore.io/manual/storage/faq/miscellaneous.html
which says that eclipsestore uses multiple threads in its implementation
So this leaves many unanswered questions:
(1) Can multiple threads issue overlapping store() requests? Which of the store() variants are safe to do so?
What about concurrent load() and store() requests?
(2) Can I load/store different parts of the object graph in overlapping multiple threads if they dont reference each other?
(3) can multiple threads load the same part of the object graph concurrently?
(4) when a thread issues a store(), is the store() complete when the function returns or is the work done in
background threads. This is relevant when the programmer wants to avoid modifying data while eclipseStore
is storing it.
(5) what other concurrency considerations can you share?
Beta Was this translation helpful? Give feedback.
All reactions