Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Lease expiration and persistence


We have some entities that have a lease expiration. For example, when we place an order, we set the lease expiration to 30 min. Afterwards the lease expiration is caught by a listener that sets the order to failed.

The question I have is about how it works with persistence. I see that if I use the @SpaceLeaseExpiration annotation, then the timestamp in which the object should be removed from the space is set when writing the object. Let's suppose that we write an order (with a lease expiration of 30 min) and after 10 min it has not been processed yet and we shutdown the space because we need to do some maintenance, and after 1 hour we startup the application again. I would expect to see that order in the space after the initial load and have 20 min remaining to be processed, but what I understand from the documentation is that it won't be loaded because it will be already expired. Am I understanding it properly? In case that's the behavior, how can I get what's my expected behavior? What do you suggest?



{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=3665]{quote}

asked 2011-05-16 09:07:40 -0500

dgaviola's avatar

updated 2013-08-08 09:52:00 -0500

jaissefsfex's avatar
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

This is the expected behavior. Object that were expired won't be loaded as part of the initial load. These will be filtered out.

answered 2011-05-16 11:13:00 -0500

shay hassidim's avatar
edit flag offensive delete link more


Thanks Shay. Do you know if there are any recommended approach to avoid this? Maybe a hook in the initial data load or something like that.


dgaviola's avatar dgaviola  ( 2011-05-16 12:26:41 -0500 )edit

To avoid the filtering at the initial load?
Just don't use the @SpaceLeaseExpiration and write objects with a specific lease duration.

shay hassidim's avatar shay hassidim  ( 2011-05-16 16:03:24 -0500 )edit

I was thinking on preserving the lease expiration, but adjust it... I guess that's something I will need to handle manually and I might need to remove the @SpaceLeaseExpiration from the classes.

Thanks Shay!

dgaviola's avatar dgaviola  ( 2011-05-16 16:15:16 -0500 )edit

You can change the value inside the space lease experiation field at initial load to your liking and get the behavior you want.

eitany's avatar eitany  ( 2011-05-17 03:16:02 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2011-05-16 09:07:40 -0500

Seen: 233 times

Last updated: May 16 '11