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

Ask Your Question
0

Lease expiration and persistence

Hi,

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?

Thanks,

Diego

{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 gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

This is the expected behavior. Object that were expired won't be loaded as part of the initial load. These will be filtered out.
See:
http://www.gigaspaces.com/wiki/display/XAP8/Leases#Leases-SpaceObjectLeasewithaPersistentSpace
http://www.gigaspaces.com/wiki/display/XAP8/POJOMetadata#POJOMetadata-SpaceLeaseExpiration
Shay

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

shay hassidim gravatar image
edit flag offensive delete link more

Comments

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.

Diego

dgaviola gravatar imagedgaviola ( 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

shay hassidim gravatar imageshay 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 gravatar imagedgaviola ( 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 gravatar imageeitany ( 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

Stats

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

Seen: 162 times

Last updated: May 16 '11