mirror of
https://github.com/corda/corda.git
synced 2025-02-22 10:10:59 +00:00
Merged in move-db-commit-at-protocol-finish (pull request #363)
Move db commit to after "protocol completed" future is set.
This commit is contained in:
commit
1d5c7963c4
@ -72,16 +72,16 @@ class ProtocolStateMachineImpl<R>(val logic: ProtocolLogic<R>,
|
||||
val result = try {
|
||||
logic.call()
|
||||
} catch (t: Throwable) {
|
||||
commitTransaction()
|
||||
actionOnEnd()
|
||||
_resultFuture?.setException(t)
|
||||
commitTransaction()
|
||||
throw ExecutionException(t)
|
||||
}
|
||||
|
||||
// This is to prevent actionOnEnd being called twice if it throws an exception
|
||||
commitTransaction()
|
||||
actionOnEnd()
|
||||
_resultFuture?.set(result)
|
||||
commitTransaction()
|
||||
return result
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user