+ try {
+ commitCoordinator.handleReadyLocalTransaction(message, getSender(), this);
+ } catch (Exception e) {
+ LOG.error("{}: Error handling ReadyLocalTransaction for Tx {}", persistenceId(),
+ message.getTransactionID(), e);
+ getSender().tell(new akka.actor.Status.Failure(e), getSelf());
+ }
+ } else {
+ ActorSelection leader = getLeader();
+ if (leader != null) {
+ LOG.debug("{}: Forwarding ReadyLocalTransaction to leader {}", persistenceId(), leader);
+ message.setRemoteVersion(getCurrentBehavior().getLeaderPayloadVersion());
+ leader.forward(message, getContext());
+ } else {
+ noLeaderError("Could not commit transaction " + message.getTransactionID(), message);
+ }
+ }
+ }