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

Ask Your Question

Evict object from space...

What is a programmatic way to evict object from space without deleting it from database (we use mirroring to DB) Thanks

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

asked 2007-11-29 11:42:04 -0500

mgrouch 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

Entry eviction done via Lease.cancel and IJSpace.update with short lease call.
The above is not supported when having External Data Source turned on. The eviction will be done based on the LRU settings.
We are planning to lift this limitation with our future releases.


answered 2007-11-29 14:14:00 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Why would you want to do that? Is it to becuase the space is full? If so, you can set the space to use LRU eviction policy.

Is it something else?


answered 2007-11-29 14:11:03 -0500

guy sayar gravatar image
edit flag offensive delete link more


If we have mirror. Will it delete expired object from database? Thanks

mgrouch gravatar imagemgrouch ( 2007-11-29 20:04:02 -0500 )edit



shay hassidim gravatar imageshay hassidim ( 2007-11-30 07:04:02 -0500 )edit

Is there any other way to evict an arbitrary entity from a space? I'm using External Data Source so I can't use Lease.cancel or GigaSpace.updateMultiple for already loaded entity via the EDS. When I called GigaSpace.clear method then it resulted into destructive SQL command DELETE... My reason is simple: rarely some records are changed directly in the database by administrator so I need somehow tell the space reread these records from EDS.

Another similar problem I'm experiencing is about leasing My "financial" application non-stop creates a huge number of orders (space entity) and writes them into a space with 60 seconds lease. I choose this period because after the time the probability of access (reading) is low and there isn't enough RAM to store all created orders in memory. They are correctly stored into the database but later I need read some orders but the GigaSpace.read returns null. It perfectly works inside the 60 seconds window but not after the lease expired. I'm using LRU caching and DefaultHibernateExternalDataSource as the external data source. I assumed that in the case of cache miss the space asks EDS and it loads the missing record but I'm probably wrong. How can I load the missing data back to the space?

I'm stuck. I really appreciate any help...


smid gravatar imagesmid ( 2008-09-01 19:29:04 -0500 )edit

Here is an important correction. Write with a short lease and update with short lease will evict the entry from the space when running in LRU mode with EDS.

Regarding the problem you reported : Sounds as a problem I've seen before. I'll check this and get back to you.


shay hassidim gravatar imageshay hassidim ( 2008-09-01 22:00:11 -0500 )edit

Hi Guy,
  you are right. I have simulated it (set the cache size very low) and it worked. Orders have been evicted from the space and later the EDS loaded some of them back to the space on demand.
  I will wait for Shay research why it doesn't work when setting short lease because I would like to manage how long orders will be kept in the space. I guess that I could use GigaMap instead GigaSpace but it's a different approach.
Maybe it would be nice to have some instrument to arbitrarily evict an entity from a space cache (not from underlying persistent storage like does Space.clear or take).


smid gravatar imagesmid ( 2008-09-02 05:32:52 -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: 2007-11-29 11:42:04 -0500

Seen: 56 times

Last updated: Nov 29 '07