Made JTA Synchronization management generic and allowing more than one + refactoring
This commit is contained in:
parent
628e5530a1
commit
559689d082
4 changed files with 70 additions and 39 deletions
|
|
@ -316,13 +316,7 @@ object Transaction {
|
|||
def begin = synchronized {
|
||||
jta.foreach { txContainer =>
|
||||
txContainer.begin
|
||||
TransactionContainer.findSynchronizationRegistry match {
|
||||
case Some(registry) =>
|
||||
registry.asInstanceOf[TransactionSynchronizationRegistry].registerInterposedSynchronization(
|
||||
new StmSynchronization(txContainer, this))
|
||||
case None =>
|
||||
log.warning("Cannot find TransactionSynchronizationRegistry in JNDI, can't register STM synchronization")
|
||||
}
|
||||
txContainer.registerSynchronization(new StmSynchronization(txContainer, this))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue