I want to ensure that my database (SQL Server) updates are idempotent, similar in functionality to the blog post below, but using Entity Framework (v5, Database First):
http://blogs.msdn.com/b/adonet/archive/2013/03/11/sql-database-connectivity-and-the-idempotency-issue.aspx
However, if I add an @Operation parameter to my insert proc, I get
"Error 2037: A mapping function bindings specifies a function ... but does not map the following function parameters: Operation"
(The @Operation would be a GUID, generated by the app, allowing the app to retry with the same GUID if it doesn't get a success response from the proc. The proc would write the GUID to a log table, and only perform the insert if the GUID doesn't exist - thus ensuring an idempotent transaction.)
Is there an elegant solution?
Release 6.1 of Entity Framework will solve this issue. (Thanks EF team - fabulous work.)
https://entityframework.codeplex.com/wikipage?title=Handling%20of%20Transaction%20Commit%20Failures%20
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