// enlist the Participant for this service:
TransactionManager transactionManager = TransactionManagerFactory.transactionManager();
RestaurantParticipant restaurantParticipant = new RestaurantParticipant(transactionId);
log.info("[SERVICE] Enlisting a Durable2PC participant into the AT");
transactionManager.enlistForDurableTwoPhase(restaurantParticipant, "restaurantServiceAT:" + new Uid().toString());
RestaurantVolatileParticipant restaurantVolatileParticipant = new RestaurantVolatileParticipant(transactionId);
log.info("[SERVICE] Enlisting a Volatile2PC participant into the AT");
transactionManager.enlistForVolatileTwoPhase(restaurantVolatileParticipant, "restaurantServiceAT:" + new Uid().toString());
} catch (Exception e) {
throw new RestaurantException("Error when enlisting participants", e);
}