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

Ask Your Question

Distributing space objects (with optimistic concurrency enabled)

What I want to do:
I have some static data or data which is not changed very often. I want to "distribute" this data to all partitions in the cluster.
Example: I have object "MyConfig" and a cluster with 2 partitions.
What I want to do is write an instance of "MyConfig" that has the same data into partition 1 and partition 2 so that I am able to always have this data locally available.

Currently I do this:

for (int partition = 0; partition < partitionCount; partition++) {

I am writing it manually in all partitions of the cluster via setting the routing key.

When I enable optimistic concurrency I start seeing exceptions because the version numbers of this two distributed objects are different. What I did as a quick workaround is this:

Object originalRoutingKey = spaceObject.routingKey();
int originalVersionId = spaceObject.getVersionId();

try {
    for (int partition = 0; partition < partitionCount; partition++) {
} finally {

Q: Is there a better way to do this??

asked 2015-01-26 05:21:37 -0500

leozilla gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Yes. There is a much better option.Have a local view running within each partition.You can create it via an API call at the @postdeploy. It will store specific objects based on the SQL you will specify.Its a very popular approach.-------- Original message --------From: forum@ask.gigaspaces.orgDate:01/26/2015 6:21 AM (GMT-05:00)

answered 2015-01-26 07:48:19 -0500

shay hassidim 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


Asked: 2015-01-26 05:21:37 -0500

Seen: 83 times

Last updated: Jan 26 '15