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

Ask Your Question

Transaction error if a space instance in a cluster is (re)starting

GS 6.5 in embedded jvm (jboss) mode, jdk 5 using primary-backup cluster. When one of the space instances in a cluster is stopped or started, the following exception is thrown when attempting read/write operation on space. The process has a proxy to the cluster, so it shouldn't be attempting to write to the backup space.

net.jini.core.transaction.TransactionException: Target space
Space-Test_container1:Space-Test not available. Operation is under transaction
- TransactionId: 1 operation terminated.

Operation is under transaction - TransactionId: 1 operation terminated.
        at com.j_spaces.core.cluster.JSpaceClusteredProxy.handleFailedOpUnderXtn(SourceFile:1496)
        at com.j_spaces.core.cluster.JSpaceClusteredProxy.handleFailedMethod(SourceFile:599)
        at com.j_spaces.core.cluster.JSpaceClusteredProxy.readMultipleBasic(SourceFile:2205)
        at com.j_spaces.core.cluster.action.ClusterSpaceReadMultipleActionListener.readMultiple(SourceFile:75)
        at com.j_spaces.core.cluster.action.ClusterSpaceReadMultipleActionListener.onAction(SourceFile:32)
        at com.j_spaces.core.cluster.action.ClusterSpaceReadMultipleActionListener.onAction(SourceFile:25)
        at com.j_spaces.core.client.AbstractSpaceProxy.readMultiple(SourceFile:583)
at com.j_spaces.core.client.AbstractSpaceProxy.readMultiple(SourceFile:566)

Caused by: com.gigaspaces.cluster.activeelection.InactiveSpaceException: [probeProxySpace-Test_container
1:probeProxySpace-Test] servers as backup-only space and can't accept any operation while primary [probe
ProxySpace-Testcontainer12:probeProxySpace-Test] space is alive.
        at com.j_spaces.core.JSpaceImpl.fm(SourceFile:1148)
        at com.j_spaces.core.JSpaceImpl.checkState(SourceFile:1115)
        at com.j_spaces.core.JSpaceImpl.checkState(SourceFile:1102)
        at com.j_spaces.core.JSpaceImpl.readMultiple(SourceFile:1525)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:585)
        at com.j_spaces.obf.nf.a(SourceFile:332)
        at com.j_spaces.obf.hq.a(SourceFile:437)
        at com.j_spaces.obf.hq.a(SourceFile:525)
        at com.j_spaces.obf.ow.work(SourceFile:174)
        at com.j_spaces.obf.oe.a(SourceFile:211)
        at com.j_spaces.obf.oe.dispatch(SourceFile:201)
        at com.j_spaces.obf.de.run(SourceFile:62)
        at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
... 1 more

Thanks in advance for any help/ideas.

1) Can you use a LocalTransactionManager with a clustered space:

spaceURL = "=/./Space-Test?clusterschema=primarybackup&clustername=spaceCluster&total_members=1,3&id=1&groups=spaceTest
Group&locators=s1:4162,s2:4162,s2:4162,s3:4162" // use unicast because multicast is disabled.

IJSpace ijSpace = SpaceFinder.find(spaceURL);
     TransactionManager trManager = LocalTransactionManager
                .getInstance( ijSpace );
// perform read, write operations using ijSpace proxy.

// Same procedure on other space instances

Is above tx possible, or do you have to use a Jini distributed transaction manager? If a dist tx manager has to be used, how can it be created for the above space URL?

2) if the primary space in a primary-backup cluser goes down (but backup spaces are up), is there a time window during which space operations will fail?

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

asked 2009-10-08 16:53:48 -0500

wasefmasood's avatar

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

jaissefsfex's avatar
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted

Seems the failover process has not been fully completed. In such a case you should sleep for few ms and try again. You might want to retry this for several times.
If you have only a single partition (primary-backup clustered schema) or your transaction access only a single partition – you can use the Local TX manger.

In general the client will fail automatically into the backup (that will turn to be a primary in the same time). Somehow in your case (I guess due-to the multiple lookups), there is some delay , and the client trying to access the backup space before it completed the election process and moved into a primary mode.

What’s your election parameters? I think you should tune these.


answered 2009-10-10 23:35:08 -0500

shay hassidim's avatar
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: 2009-10-08 16:53:48 -0500

Seen: 232 times

Last updated: Oct 10 '09