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

Ask Your Question

Lease and persistence

I have a couple of question regarding lease, mirror service and read-only persistence:

  • How does the lease affect persisting into database via mirror service?
  • What's the best practice for using lease? Should I always use Lease.FOREVER on the objects that I want to persist?



This thread was imported from the previous forum.
For your reference, the original is available here

asked 2008-04-03 11:05:20 -0500

noiseba gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted


Does your space using External Data source or just replicates its data to the mirror?
Please note that if the space has an External Data source configured , persistent entries do not expire even if their lease is less than FOREVER. Entries will be evicted only when you will run in LRU cache policy mode based on the memory manager settings.


answered 2008-04-03 11:35:08 -0500

shay hassidim gravatar image
edit flag offensive delete link more


To properly answer the lease query, you need to think of the reasons for which you are using the space. If you are using the space to hold your data (i.e. your system of records), then you should use Lease.FOREVER, if you are using the space to as a write/read-throught to a database, than you might want to consider different approaches.

(leased objects are not deleted from the mirror).

Can you detail your use cases?


answered 2008-04-03 11:11:53 -0500

guy sayar gravatar image
edit flag offensive delete link more


Basically, we'd like to use space as the primary storage, mirror the objects into the database and use the database as the backup in case the space gets restarted. We also have a concern about memory usage if we use Lease.FOREVER on all our data. Should we consider lease renewal?



noiseba gravatar imagenoiseba ( 2008-04-03 11:20:16 -0500 )edit


What are the concerns re memory usage? RAM size? Are you limited in space?


guy sayar gravatar imageguy sayar ( 2008-04-03 11:34:24 -0500 )edit

We are not really in space. But we'd like to be prepared for memory usage increase.

noiseba gravatar imagenoiseba ( 2008-04-03 12:23:33 -0500 )edit

We use mirror service and read-only external data source on the same space so that we can read the stored data from database when the space is restarted. The space never writes directly to the external data source. So consider the following scenario, what will happen?

  • I write something into the space with a less than FOREVER lease.
  • The data is persisted into the database via mirror service.
  • The lease expires in the space.
  • I try to read the same data again.

Also, what is the space going to do with the data that's not in the memory if we use LRU cache policy? Does it swap them to the disk or read them again from the database if needed?



noiseba gravatar imagenoiseba ( 2008-04-03 12:32:20 -0500 )edit

A space with External Data Source configured allows the space to act as a layer on top of the database - i.e. expired entries would not be removed also from the database (would not trigger relevant method to delete the associated row(s) from the database).
Please note - A space with External Data Source configured does not mean a space replicating to a Mirror Service.
The Storage Adapter (RDBMS black box) persistency and the indexed file persistency options do remove the expired entries from the persistency media (RDBMS , ODBMS) since in this case the persistency media is exact image of the space memory.

shay hassidim gravatar imageshay hassidim ( 2008-04-05 15:15:14 -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: 2008-04-03 11:05:20 -0500

Seen: 154 times

Last updated: Apr 03 '08