-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wcf service transaction #17
Comments
Transaction for data modifications starts only for batch queries an commited exactly after execution. For simple update or insert starting transaction is not necessary. |
Ok lets say I have something like this:
For this situation I would expect that if the transaction is commited , then person is inserted and all products are updated. Is this so? |
Try to use |
Ok so this would do the desired process: using (var db = new DbNorthwindService())
{
db.BeginBatch();
// ..create a person..
// Person is one table.
db.Insert(person);
// Product is another table
db.Product
.Where(p => p.UnitsInStock == 0)
.Set(p => p.Discontinued, true)
.Update();
db.CommitBatch();
} |
It is works for you? |
I hav not tested it yet.. I forgot to put the question mark at the end :-) |
Works like expected! We should add an info to the documentation that batches cover a transaction... |
If I use your WCF Service, how is it like with transactions. Is the transaction commited if the using of the service context ends? What if the connection is closed before the using block ends (error case) , is the query executed?
The text was updated successfully, but these errors were encountered: