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

Ask Your Question
0

Force update of hibernate level2 cache space possible?

Hello,

I'm new to Gigaspaces and have a little issue I can't quite resolve myself.

I started working on a Spring web app project that uses GigaSpaces as HttpSession alternative as well as level2 cache for Hibernate.

Every now and then the database entries are updated and I'm looking for a way to update the level2 cache without having to stop either application(s) or the space / cluster.

The plan is to configure the level2 cache to use a partitioned master-local cache topology. From how I understood it, updates to the Master will automatically update the local embedded caches. My question now is how I can get hold of the Master cache?! Or is there genuinely a better way to achieve my goal?

I've tried a few approaches but since I don't know exactly what I'm doing, I'm a bit stuck.

Any ideas / suggestions / manuals / wiki pages that I might find helpful?!

(I've been reading through all sorts of documentation, all pages on gigaspaces.com and other posts but couldn't find what I was looking for. I don't want to waste anyone's time so if I should have missed sth, please drop me a link and I'll have a look).

Please let me know if you need more details on setup and config to answer my question.

Thank you very much in advance,

Jess

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

asked 2008-03-11 11:44:05 -0500

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

In order to access only the master space your URL should be:
jini:////spaceName

With the above the client will read only from the remote master space.

In case you are using openspaces the space declarations should be:
<os-core:space id="space" url="jini:////mySpace" />

In order to have a local cache running your URL should be:
jini:////spaceName?useLocalCache

In case you are using openspaces the space declarations should be:
<os-core:space id="space" url="jini:////spaceName" />
<os-core:local-cache id="localCacheSpace" space="space" />

With the above the client will read first from the local cache and if not found will read from the master space.

Please note that in order updates will be propagated to the local cache the updater should have a local cache running ? i.e. it URL should include the useLocalCache tag.

Shay

answered 2008-03-11 13:09:27 -0500

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Hi Shay,

Thanks for your reply. Guess I was a bit frustrated last night...:)

I'm now looking up the master cache like you suggested without the useLocalCache etc, but I still run into the same problem: the clean() method only cleares one of the currently two containers... At least that's how it looks like in the management console.

I can see that the mContainerName property is set to mySpacecontainer2 and therefore it makes sense that only this container is cleared... But how do I go about clearing container1? Any hints?

Thanks,

Jess

jessicad2 gravatar imagejessicad2 ( 2008-03-12 09:53:49 -0500 )edit

When using a clustered proxy - The clear operation should remove entries from all partitions. See: http://www.gigaspaces.com/wiki/displa...

The clean is not a clustered operation. You should use clear with null as a template and null as the transaction instead.

Are you using opeanspaces with non clustered proxy (default) ? If so use the <clustered> tag as part of the space declaration. This will make sure the above will work correctly.

If you have many entries within the space and have sync replica space make sure you have the <multiple-opers-chunk-size> as part of the cluster schema have a value other than -1. 5000 as a value would be good for most cases.

Shay

shay hassidim gravatar imageshay hassidim ( 2008-03-12 10:12:02 -0500 )edit

Doe! I've read this page before, but did it click? No... :)

It works fine now with clean(null, null), thanks for your help!!!

I'm not sure if what's going on regarding the cluster config as we're still at an early stage, but I'll keep your other comments in mind.

Again, thank you very much.

Jess

jessicad2 gravatar imagejessicad2 ( 2008-03-12 10:50:36 -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: 2008-03-11 11:44:05 -0500

Seen: 50 times

Last updated: Mar 11 '08