views:

1224

answers:

1

Playing around with MongoDB and NoRM in .NET.

Thing that confused me - there are no transactions
(can't just tell MongoConnection.Begin/EndTransaction or something like that).

I want to use Unit of work pattern and rollback changes in case something fails.

Is there still a clean way how to enrich my repository with ITransaction?

+7  A: 

MongoDB doesn't support complex multi-document transactions. If that is something you absolutely need it probably isn't a great fit for you.

In most cases, however, we've found that complex transactions aren't a requirement. All operations in MongoDB are atomic on a single document, and we support nice update modifiers, which make a lot of operations that would need a transaction easy to implement (and fast).

mdirolf
I didn't get that `update modifiers` part. How exactly can they help? (keep in mind that I'm complete newbie at this) :)
Arnis L.
update modifiers allow you to perform certain complex operations atomically with a single operation - thinks like "increment the value of this field by x" or "add a new value to this array".
mdirolf