MongoDB的交易? [英] MongoDB transactions?
问题描述
玩弄的MongoDB和规范的.NET。
Playing around with MongoDB and NoRM in .NET.
的事情,弄得我 - 有没有交易
(不能只是告诉 MongoConnection.Begin / EndTransaction
或类似的东西)。
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.
是否还有干净的路该怎么丰富我与ITransaction库?
Is there still a clean way how to enrich my repository with ITransaction?
推荐答案
MongoDB中不支持复杂的多文档交易。如果这是你绝对需要它可能不是一个非常适合你。
MongoDB doesn't support complex multi-document transactions. If that is something you absolutely need it probably isn't a great fit for you.
在大多数情况下,然而,我们发现,复杂的交易,不是必需的。 MongoDB中所有的操作都是原子在一个单一的文件,我们支持不错更新修饰,这让很多运营这将需要很容易实现(和快速)的交易。
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).
这篇关于MongoDB的交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!