+ final TransactionContextWrapper wrapper = e.getValue();
+
+ // The remote tx version is obtained the via TransactionContext which may not be available yet so
+ // we pass a Supplier to dynamically obtain it. Once the ready Future is resolved the
+ // TransactionContext is available.
+ Supplier<Short> txVersionSupplier = new Supplier<Short>() {
+ @Override
+ public Short get() {
+ return wrapper.getTransactionContext().getTransactionVersion();
+ }
+ };
+
+ cohorts.add(new ThreePhaseCommitCohortProxy.CohortInfo(wrapper.readyTransaction(), txVersionSupplier));