I have a requirement where i need to write to multiple DB. If any exception occurs while writing to anyone of the DBs, i want to rollback everything.
E.G.
Session userSession= a.getUserDBSession();
Session departmentSession= a.getDepartmentSession();
Session carSession= a.getCarSession();
//Do some work and write to User DB
// Do some work and write to Department DB
//Do some work and write to Car DB
// commit everything.
Note: Session is Hibernate Session Any help would be highly appreciated