Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entitity Framework: Change tracking in SOA with POCO approach

In our layered application, we are accessing database via WCF calls. We are creating and disposing contexts per request. Also we are using POCO approach.
My question is, in pure POCO model (completely persistent ignorant POCOs) is it possible to track the changes, while we are creating and disposing context per request (as previous context is disposed in that service call)? If yes how EF handles this situation? As far as I can see 2 mechanisms (snapshot based change tracking and notification based change tracking with proxies) will not be able to handle this? If not, how should we handle context so that we are able to track the changes?

like image 804
rovsen Avatar asked Feb 22 '10 23:02

rovsen


1 Answers

I'd say:

Do not use self-tracking entities in a pure SOA environment: The self-tracking entities only work when your clients use the generated proxy classes.

When you're doing SOA by the book, you cannot expect your clients to be .Net, or even more, .Net 4.0; Which is the only scenario in which self-tracking entities will work. Your services will be useless to any other clients.

Just My 2 cents, Regards, Koen

like image 59
KoenJ Avatar answered Sep 17 '22 00:09

KoenJ