[infinispan-dev] Undesired behavior

Mircea Markus mircea.markus at jboss.com
Fri Mar 30 06:17:13 EDT 2012


On 30 Mar 2012, at 10:47, Pedro Ruivo wrote:

> With the optimistic locking scheme, I think I can use the same approach. 
> The locks are only acquired in the prepare phase, so I can discard the 
> prepare message, right?
yes.
> 
> But if the pessimist locking scheme is in use?
> 
> One possible solution is, If rollback is delivered first, the 
> TxInterceptor skips the write commands replays and in 
> PessimistLockingInterceptor, invoke the lock.unlockAll(ctx) method.
so during the rollback you release the resources (locks, changes) but keep the tx in the tx table as you know you need to also receive a prepare. When prepare is received the tx would be simply removed from the tx table without any further work. That should work.
> 
> What do you think?
> 
> Another issue is where I can implement this behavior? I mean, in TO, 
> this behavior is implemented in TotalOrderInterceptor a
Do you want to implement TO for pessimistic transactions? I always thought about total order as only being practical for optimistic tx. 




More information about the infinispan-dev mailing list