We use Gigaspaces as an in-memory database and back up our data by mirror it to MongoDB, which is our persistence storage. We have a mirror service that makes sure everything we create, update and delete is either written or removed from the permanent storage.
Classes saved with leases have a field named "lease" of type long with a getter annotated with @SpaceLeaseExpiration. This ensures the entity is not loaded during an initial load if expired. This works as expected.
The problem arise when a lease expire while the space is running. The object does *not* get its corresponding entity removed from Mongo.
The workaround is to create a polling container which listen for expired leases and manually remove it from Mongo. This is a big pain though.
We expect it to work as a take operation, which does indeed removes the corresponding entity in Mongo.
Using Gigaspaces 12.1.1.
↧