Replies: 7 comments
-
Quite certain that with There are a few other proposals here to expand unit-of-work scenarios with |
Beta Was this translation helpful? Give feedback.
-
@HaloFour one could argue that forgetting to commit a transaction or dispose of a resource is also dangerous as it could lead to data loss and memory leaks. Sorry, I did not check for pre-existing issues. Maybe I should wait until the migration and cleanup of existing stuff is complete. Anyway, I think the trick is to not introduce new syntax if possible. Do you think it's worth closing this one based on all those other proposals? |
Beta Was this translation helpful? Give feedback.
-
There's #85 which is general purpose. Also a bit of conversation in #93 regarding |
Beta Was this translation helpful? Give feedback.
-
Yes, calling Consider importing data from a flat file. This typically occurs in a loop and, more often than not, has some sort of "early bail out" mechanism so that if more than a given number of SQL failures occur the entire transaction is aborted so the user can fix their file without worrying about trying to figure out which rows were imported and which rows weren't. In the case of |
Beta Was this translation helpful? Give feedback.
-
I was once propose return using syntax dotnet/roslyn#16958 Which also include custom disposal logic I have an idea that we should have something like yield from But my idea is, that syntax must enforce caller to explicitly make block scope to ensure that the cleanup(completion) must be called one way or another To add transaction syntax to do this work might be a solution? |
Beta Was this translation helpful? Give feedback.
-
Probably I created a duplicate. But this proposal have a little bit more capability - obtain exception. |
Beta Was this translation helpful? Give feedback.
-
After C# 8.0 release, I have revisited using operator improvements and created new proposal which is superset for this one. See, #3025 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
At the moment it is easy to forget to complete a transaction:
What if there was a new
ICompletable
interface that would look and work likeIDisposable
but would only be called on a successful completion of ausing
block?Pre-emptive Q&A:
try-catch
just like withIDisposable
.Beta Was this translation helpful? Give feedback.
All reactions