mirror of
https://github.com/corda/corda.git
synced 2025-06-22 17:09:00 +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:
@ -72,16 +72,16 @@ class ProtocolStateMachineImpl<R>(val logic: ProtocolLogic<R>,
|
|||||||
val result = try {
|
val result = try {
|
||||||
logic.call()
|
logic.call()
|
||||||
} catch (t: Throwable) {
|
} catch (t: Throwable) {
|
||||||
commitTransaction()
|
|
||||||
actionOnEnd()
|
actionOnEnd()
|
||||||
_resultFuture?.setException(t)
|
_resultFuture?.setException(t)
|
||||||
|
commitTransaction()
|
||||||
throw ExecutionException(t)
|
throw ExecutionException(t)
|
||||||
}
|
}
|
||||||
|
|
||||||
// This is to prevent actionOnEnd being called twice if it throws an exception
|
// This is to prevent actionOnEnd being called twice if it throws an exception
|
||||||
commitTransaction()
|
|
||||||
actionOnEnd()
|
actionOnEnd()
|
||||||
_resultFuture?.set(result)
|
_resultFuture?.set(result)
|
||||||
|
commitTransaction()
|
||||||
return result
|
return result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user