15,792,608 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Python questions
View PHP questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Kent K (Top 1 by date)
Kent K
18-Jul-11 14:17pm
View
Granted, my experience with WCF and transactions doesn't involve an EF model, but I wanted to provide notice on how your problem could be solved (again, I probably should have stated that it is a solution that isn't using EF model but for people finding your post for/by other means. .).
So, I have a system where I've built WCF services that run in IIS. I can pass custom objects of my choosing to them or retrieve objects from them like you would expect. My sytem is 3-tier. A desktop client is, well, the client. The WCF service (middle) uses SQL server for the backend. In the client I can wrap 7-8 different WCF service calls, some of which require an id from a foreign key field to be able to do an insert in a related table, in a transaction. With MSDTC configured in IIS and SQL server, a transaction will flow from client to service to db and all the way back to the client such that if there is a problem anywhere it simply rolls back and I don't have to do any messy "unwinding" of partial record inserts and what have you, myself.
That's the scenario I'm familiar with with behavior you questioned about. I'm not sure what level of control you have with EF models and their generated services, for transactions. Perhaps you'll have to make a service manually to do the task you are needing to be done instead of relying on the EF model to do it? Or hopefully there is a way to tell the EF model to make the service and a particular service method "transactional" in nature. The service and service methods do need to be marked with attributes to get it all to work.