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

Ask Your Question

LocalTransactionManager/Object locking etc.

Just getting started with Gigaspaces, so have very limited knowledge of the product.

Question - I would like to build a simple distributed counter; i.e. store a counter object in the space and increment it atomically. When two clients try to increment the counter, one of them should block before getting an exclusive access to the counter for incrementing. What is the best way to acheive this?

I modified HelloWorldTransaction.java sample program by spawning mutiple threads, but I get the following exception and basically there is a deadlock.

"com.j_spaces.core.client.CacheTimeoutException: Entry 12125296125COUNTER00 is locked under another transaction. Operation timeout expired"

How do I solve this problem? Is there a code snippet for this?

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

asked 2007-03-16 17:01:00 -0600

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2007-03-16 17:04:00 -0600

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: 2007-03-16 17:01:00 -0600

Seen: 27 times

Last updated: Mar 16 '07