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

issue where connection is already open #15

Merged
merged 1 commit into from
Nov 15, 2018
Merged

Conversation

h0wXD
Copy link
Contributor

@h0wXD h0wXD commented Nov 15, 2018

Hi @verdie-g

Could you have a look and see whether this causes any problems on your side.
On my side I had exceptions thrown when the stored proc lib is used where a connection was already used before invoking the sp. Crashing with following error :

System.InvalidOperationException: The connection was not closed. The connection's current state is open.
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)
   at System.Data.SqlClient.SqlConnection.Open()
   at StoredProcedureEFCore.StoredProcBuilder.OpenConnection() in C:\Git\gravitymain\StoredProcedureEFCore\StoredProcBuilder.cs:line 214
   at StoredProcedureEFCore.StoredProcBuilder.Exec(Action`1 action) in C:\Git\gravitymain\StoredProcedureEFCore\StoredProcBuilder.cs:line 87

Thanks a lot for this lib. It may be because it is being used in a project mixed with EF.

@verdie-g
Copy link
Owner

Hi,

Thanks for your PR. Someone once told me to make these checks, but I wasn't listening. Do you have any steps to reproduce? The connection is supposed to be closed after each stored procedures.

@verdie-g verdie-g merged commit 02a3a6c into verdie-g:develop Nov 15, 2018
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

Successfully merging this pull request may close these issues.

2 participants