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

Ask Your Question
0

LRU and ALL In Cache: Design issue

Dear all I have a design issue for which I need your advice. I am implementing gigaspace at server-side for our existing java application using the partitioned topology and persistent space schema along with hibernate.

THE ISSUE IS SERCHING OF OBJECTS USING NON-ID FIELDS.

LRU: If I use LRU mechanism so that some data is their in database and some in the space, only ID based search assures complete dataset. e.g. I am trying to serch for Persons with Lastname L. Now some of them might be there in the space and some in the database. As lastname is not the unique id, the space won't know if it contains all of them and would return only an incomplete set.

ALL-In-Cache: I need to preload all the objects in the space so that no object is left out in DB. I have planned to do it by putting a method in init() of a servlet , where I WOULD USE READMULTIPLE WITH THE NULL FIELDED CLASS TEMPLATES. But can I be sure that it loads all the data? If I try to do this and the system finds that there is no more memory left in the spaces, what would be its behaviour?

HOW TO LOAD ALL DATA IN SPACE WITHOUT FAIL?

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

asked 2008-01-15 20:49:22 -0500

bahata 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

Hi Bahata,

You should go with ALL_IN_CACHE to avoid database queries.

"But can I be sure that it loads all the data? If I try to do this and the system finds that there is no more memory left in the spaces, what would be its behaviour?"

If you are expecting a big response use the GSIterator. See [ http://www.gigaspaces.com/wiki/displa... ]

"HOW TO LOAD ALL DATA IN SPACE WITHOUT FAIL? "

What do you mean by that? There a number of way to make sure that a process has competed (use an entry in the space to mark it for instance).

answered 2008-01-15 23:30:37 -0500

guy sayar gravatar image
edit flag offensive delete link more

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: 2008-01-15 20:49:22 -0500

Seen: 503 times

Last updated: Jan 15 '08