I know that in Rails all ActiveRecord callbacks are executed inside transaction. So if something goes wrong nothing is changed/wrong. Will Mongoid gem handle this in the same way (no transactions available as far as I know)?
Thx!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
There’s no such thing as a transaction in mongodb, so no this won’t be handled for you. Should something blow up in an
after_saveor something like that you’ll need to fix the damage yourself.The general approach (as the FAQ hints at) is to try and design around this by using mongo’s atomic modifiers.