In my application I need to store some data to the RDBMS
DB and some data to the MongoDB
in the same transaction and I am using Spring JTA
for my RDBMS
transactions.
I am new to MongoDB
and i am not sure that will this Spring JTA
supported by MongoDB
. What's the way or api to handle a transaction programmaticaly in MongoDB
as MongoDB
doesn't support transaction.
As like working with RDBMS
and by annotating a method @Transactional
, all operation's in method done as a single atomic operations and if an error occur automatic rollback done by Spring JTA
but how we can achieve this using MongoDB
?
You can use atomic operations or two-phase commit. Also Check this out. This article explains about plugin developed for
Mongo
that promises not onlytransactions
but also a boosting in performance.