-
1. Re: Grouping Api and its Effect on JTA Transaction
an1310 Aug 29, 2012 12:49 PM (in response to fangyuchen)Take a look at synchronizations (https://docs.jboss.org/author/display/ISPN/Infinispan+transactions)
The grouping API does have benefits; I use it for my use case where I have to pessimisticly acquire locks on keys across several caches in the same transaction. By knowing the group, I can execute it on the local data owner, which means all lock acquisition is local -- no RPC involved. You'll probably see a similar benefit.
-
2. Re: Grouping Api and its Effect on JTA Transaction
fangyuchen Aug 29, 2012 1:18 PM (in response to an1310)I checked the synchronizations. But I do not think it can keep the consisitency between the two cache as two-phase transction does.
Do you mean to use the lock operation to explictly acquire the lock on the cache?
In my use case, it is possibile that the Node A process the transcation but the Node B own all the data. So the RPC can not be avoided.
-
3. Re: Grouping Api and its Effect on JTA Transaction
an1310 Aug 29, 2012 1:26 PM (in response to fangyuchen)Depending on what you mean about "consistency," you may also need to check out recovery.
As for your use case, you may also want to check out the DistributedExecutor service. That way you can serialize a task that executes on the main key owner. You'll still incur a RPC marshalling the requisite data, but the transaction can be run in the task context. This way, the transaction only runs on the main data owner and any backups -- say (B,C), rather than (A,B,C).
-
4. Re: Grouping Api and its Effect on JTA Transaction
fangyuchen Aug 29, 2012 2:22 PM (in response to an1310)To achieve the ACI (not D, its in memory) . The two-phase transaction has its problem. But it is much stronger than the synchronizations.
Use DistributedExecutor is an option need invesigate because we hope to use client-server mode finally when hotrod fully support JTA. (Infinispan team guys, please don't make us wait too long. we keen to that)
Thank you for your advice.