From 476db876d9a73d09b70bbb89b6a3ce04f90cfed4 Mon Sep 17 00:00:00 2001 From: "rick.parker" Date: Fri, 16 Sep 2016 13:54:33 +0100 Subject: [PATCH] Move db commit to after "protocol completed" future is set. Move db commit to after "protocol completed" future is set. --- .../node/services/statemachine/ProtocolStateMachineImpl.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node/src/main/kotlin/com/r3corda/node/services/statemachine/ProtocolStateMachineImpl.kt b/node/src/main/kotlin/com/r3corda/node/services/statemachine/ProtocolStateMachineImpl.kt index bcf8a60502..0e3581c766 100644 --- a/node/src/main/kotlin/com/r3corda/node/services/statemachine/ProtocolStateMachineImpl.kt +++ b/node/src/main/kotlin/com/r3corda/node/services/statemachine/ProtocolStateMachineImpl.kt @@ -72,16 +72,16 @@ class ProtocolStateMachineImpl(val logic: ProtocolLogic, 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 }