Fixed deadlock when Transactor is restarted in the middle of a transaction
This commit is contained in:
parent
b98cfd5c1f
commit
4d130d544d
6 changed files with 82 additions and 63 deletions
|
|
@ -149,7 +149,14 @@ class GlobalStm extends TransactionManagement with Logging {
|
|||
def atomic[T](body: => T)(implicit factory: TransactionFactory = DefaultGlobalTransactionFactory): T = atomic(factory)(body)
|
||||
|
||||
def atomic[T](factory: TransactionFactory)(body: => T): T = {
|
||||
factory.boilerplate.execute(new TransactionalCallable[T]() {
|
||||
/* MultiverseStmUtils.scheduleDeferredTask(new Runnable {
|
||||
def run = try {
|
||||
getTransactionSetInScope.tryJoinCommit(getRequiredThreadLocalTransaction, TransactionConfig.TIMEOUT, TimeUnit.MILLISECONDS)
|
||||
clearTransaction
|
||||
} catch {
|
||||
case e: IllegalStateException => {}
|
||||
}})
|
||||
*/ factory.boilerplate.execute(new TransactionalCallable[T]() {
|
||||
def call(mtx: MultiverseTransaction): T = {
|
||||
if (!isTransactionSetInScope) createNewTransactionSet
|
||||
factory.addHooks
|
||||
|
|
@ -159,7 +166,7 @@ class GlobalStm extends TransactionManagement with Logging {
|
|||
mtx.commit
|
||||
// Need to catch IllegalStateException until we have fix in Multiverse, since it throws it by mistake
|
||||
try { txSet.tryJoinCommit(mtx, TransactionConfig.TIMEOUT, TimeUnit.MILLISECONDS) } catch { case e: IllegalStateException => {} }
|
||||
clearTransaction
|
||||
// try { txSet.joinCommit(mtx) } catch { case e: IllegalStateException => {} }
|
||||
result
|
||||
}
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue