The raven client (IDocumentSession
) doesn't send anything to the server until SaveChanges
is called. So it could be considered as a UnitOfWork implementation, right?
Am I correct in thinking that the only difference between SaveChanges
and Transaction.Commit
is that the latter rolls back all changes if something failed during the commit?
If you are doing a single operation, there is no need to use an explicit transaction since the SaveChanges
results in a implicit transaction.
If you make use of System.Transactions
, you can perform multiple operations, ie multiple SaveChanges
using the same transaction. Raven will manage the transactions over http using a request header.
Read more in the docs: http://ravendb.net/documentation/docs-api-transactions
SaveChanges()
operate in a transaction, so if you are modifying multiple documents, all of them would be saved, or none would.
Also support System.Transactions
, but usually it is not needed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With