[infinispan-issues] [JBoss JIRA] Commented: (ISPN-1168) Support for interposed synchronization
Scott Marlow (JIRA)
jira-events at lists.jboss.org
Wed Jun 8 22:38:59 EDT 2011
[ https://issues.jboss.org/browse/ISPN-1168?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12607325#comment-12607325 ]
Scott Marlow commented on ISPN-1168:
------------------------------------
The interposed synchronization behaviour is described here: http://download.oracle.com/javaee/6/api/javax/transaction/TransactionSynchronizationRegistry.html#registerInterposedSynchronization%28javax.transaction.Synchronization%29
One concern (now/future) to be aware of is, once an interposed synchronization beforeCompletion() is invoked for the current active transaction, no further calls to transaction.registerSynchronization() can succeed (their turn to run is complete, game over). This is the situation that we are currently in (look at the exception call stack again above). The workaround, is to cascade the use of an interposed synchronization (use TransactionSynchronizationRegistry.registerInterposedSynchronization instead of Transaction.registerSynchronization). I'm not sure of all of the cases where this could occur yet (maybe CacheLoaders) but wanted to raise the concern so we all understand the possible side effects and solutions.
To summarize the possible solution if this (too late registration of a tx level sync) does happen (in another layer after fixing this jira):
1. Consider getting the Transaction.registerSynchronization to occur before the transaction ends or as part of another Synchronization that was configured via Transaction.registerSynchronization.
2. Alternative is to use TransactionSynchronizationRegistry.registerInterposedSynchronization to register the synchronization in question instead.
> Support for interposed synchronization
> --------------------------------------
>
> Key: ISPN-1168
> URL: https://issues.jboss.org/browse/ISPN-1168
> Project: Infinispan
> Issue Type: Task
> Affects Versions: 5.0.0.CR4
> Reporter: Scott Marlow
> Assignee: Mircea Markus
> Fix For: 5.0.0.CR5
>
>
> Support for interposed synchronization should be configurable to avoid the following exception:
> http://pastie.org/2035067
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the infinispan-issues
mailing list