code_junkie

HibernateTransactionManager(Spring) with multiple Session Factories

Nov 13th, 2011
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. TransactionStatus status = transactionManager.getTransaction(def);
  2. try{
  3. doHibernateStuff1(); //Does Hibernate stuff with session
  4. //factory related to Tx Manager
  5. doHibernateStuff2(); //Does Hibernate stuff with session
  6. //factory not related to Tx Manager
  7. }
  8. catch(DataAccessException){
  9. transactionManager.rollback(status);
  10. }
  11. transactionManager.commit(status); //Exception happens here.
Add Comment
Please, Sign In to add comment