[infinispan-dev] PutForExternalRead and autoCommit

Galder Zamarreño galder.zamarreno at redhat.com
Thu Nov 17 03:30:04 EST 2011


Hi,

Forcing caches to be either transactional or non transactional caches causes some issues with operations such as putForExternalRead with default configuration options.

Assuming we have a transactional cache, if autoCommit is on (default), putForExternalRead will:
1. Suspend the ongoing transaction
2. Will create a brand new transaction due to implicit transaction creation logic in auto commit.

This is not good.

I don't think we can just disable autoCommit globally if someone calls putForExternalRead because there might other operations not called within a transaction, but there's a point to be made here: 
The whole point of calling PFER is to suspend on-going transactions, so it kinda implies that transactions are managed externally already.

If we don't disable autoCommit globally, there's a few things that we should consider doing:
1. Print a WARN if PFER is called and autoCommit is on? 
2. Apart from the message, some kind of way for putForExternalRead to instruct the implicit transaction logic to avoid creating a new transaction in this case.

WDYT?
--
Galder Zamarreño
Sr. Software Engineer
Infinispan, JBoss Cache




More information about the infinispan-dev mailing list