I want to update the DB and a server with some new data in one transaction.
I'm using java 8 and i was looking for Java transaction API.
I have found JTA
but saw no code example. Can someone please link to one?
but there were about DB transaction and had no code example.
I want to make the transaction at a higher lever than the DAL level
as it wraps the peer-server update as well.
private void updateDbAndServer() throws Exception {
if (rulesUiRepository.updateRulesUiSnapshot(nonSplittedRulesSnapshot) == -1)
throw new RuntimeException("cannot save ui snapshot in DB");
Map<RuleConditionBl, RtRule> splittedMap = nonSplittedRulesSnapshot.toSplittedMap();
anotherService.updateConfig(splittedMap);
}