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