code_junkie

What is the 'best' way to do distributed transactions across multiple databases using Spring and Hibernate

Nov 11th, 2011
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.30 KB | None | 0 0
  1. try {
  2. TransactionTemplate tt = new TransactionTemplate(txManager);
  3.  
  4. tt.execute(new TransactionCallbackWithoutResult(){
  5. protected void doInTransactionWithoutResult(
  6. TransactionStatus status) {
  7. updateDb1();
  8. updateDb2();
  9. }
  10. } catch (TransactionException ex) {
  11. // handle
  12. }
Add Comment
Please, Sign In to add comment