Skip to content
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

Query supports DbConnection (hence external transactions) but Execute doesn't #301

Closed
mikebeaton opened this issue Feb 9, 2017 · 4 comments

Comments

@mikebeaton
Copy link
Contributor

mikebeaton commented Feb 9, 2017

In Massive.Shared.cs, Query has a variant which takes an open DbConnection public virtual IEnumerable<dynamic> Query(string sql, DbConnection connection, params object[] args) as well as a variant which creates and opens its own connection public virtual IEnumerable<dynamic> Query(string sql, params object[] args).

However Execute only has variants which do not take a DbConnection. It might make sense to add variants of (all three?) public versions of Execute which can take an open connection? It would be fairly trivial to do this by adding an optional second (in all cases) DbConnection parameter to each of these methods, but this would be a potentially breaking change to the interface (probably only in rare cases?). Possibly one for a future major version of Massive...?

@mikebeaton
Copy link
Contributor Author

In this case I think I have a reasonably specific and important use case - which is to be able use Massive Execute within a larger, user-controlled transaction.

@FransBouma
Copy link
Owner

Be specific please. Breaking changes are a no-go, so if something requires a breaking change, it won't happen. Additionally, what problem does it solve? Is something not possible today, and what exactly is it, that can't be done, so that is addressed.

@mikebeaton
Copy link
Contributor Author

I understand that a breaking change won't happen. I do think that I have a reasonably specific use case, though: I want to be able to execute Massive commands within my own, outer transaction (within which I am also doing other, non-Massive, things). That is quite specific, isn't it?

@mikebeaton
Copy link
Contributor Author

Should I close these (#300, #301) for now? They're both not urgent (at the highest!), and both only occurred to me as a result of trying to match my own Create and Execute patterns for proposed SP support (#293) to what is already in there.

@mikebeaton mikebeaton changed the title Query supports DbConnection but Execute doesn't Query supports DbConnection (hence external transactions) but Execute doesn't Feb 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants