I have two different DB aliases for which I need to manage transaction. What i am currently doing have a main service from which i invoke the following steps
- start a transaction on the first DB say db1
- start a transaction on the first DB say db2
- Invoke a service A that inserts a record into a table of db1
- Invoke a service B that inserts a record into a table of db2, inside this service, on error rollback db2
- Commit on db1
- Commit on db2
- Rollbacl db1
This sequence works perfectly for db2 but doesnt not rollback for db1. I need to rollback db1 if there was error in service that inserts record into db2.
Any help is appreciated.