I need to execute a multiple MySql Queries and Multiple MongoDB queries. If the execution of one of the queries fails (SQL or Mongo) I must rollback all the executed queries. Is that possible?
Asked
Active
Viewed 920 times
0
-
Can you supply the type of operations being performed as well as their order? – kwolfe Jun 18 '14 at 16:36
-
all the queries have one type, it is an insert operation – hich Jun 18 '14 at 16:55
1 Answers
0
You might want to check out Spring Transactions. This is one of the solutions I am aware of. Another solution might be to do it manually: store the current documents/rows try to update them and roll back if necessary.
It might help to take a step back and ask yourself whether it really makes sense to have two DBMS with dependent transactions. I'd do everything to be able to store the related data in one DBMS.

Markus W Mahlberg
- 19,711
- 6
- 65
- 89
-
i am developping a domain specific language unifying Mysql and mongo query language thats why i need dependent transactions. Can you please give me a pseudo code or a tutorial how to manage the transactions if for example i need to execute one mysql insert query and one mongo insert query. i have no idea how to do this. – hich Jun 19 '14 at 22:44