mirror of
https://github.com/corda/corda.git
synced 2025-02-20 17:33:15 +00:00
Move db commit to after "protocol completed" future is set.
Move db commit to after "protocol completed" future is set.
This commit is contained in:
parent
9a6c6b17d6
commit
476db876d9
@ -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