Scheduled for investigation in rc2. From the top of my head, MemoryStoreConnection.commit() should already call sync() and, depending on the configured sync delay, synchronize the changes to disk.
Max, I don't exactly understand this feature request. Isn't this behaviour already covered by setting the syncDelay parameter to 0?
Rescheduling to a future release as the request is unclear.
I would like that commit() *immediately* does internally a commit() followed by a sync(). So that after commit() I can be sure my changes are on disk.
The requested behaviour is already available, just make sure that the syncDelay parameter of the MemoryStore is equal to 0 (which is the default).
Hmm, let's try to be more clear. A MemoryStore is great, because its so much faster than a persisten store. However, it would be ideal to be able to control the sync-time point. Even automatically writing on disk costs too much performance. What I would like is:
- MemoryStore *never* writes automatically to a backend
- *unless* sync() or committ() is called explicitly.
As far as I understood, syncDelay=0 would write to backend after each transaction.
You can set the syncDelay parameter to a negative value to disable the sync upon commit. The MemoryStore will then only sync to disk when it is shut down, or when sync() is explicitly called.
Almost perfect. How can I call sync() when the MemoryStore is hidden deep in a stack of sails? Is there any other way than traversing the sails by hand, until I found a MemoryStore? What are the semantics of calling commit() at a higher sail? Will it implicitly call sync() on the MemoryStore?