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

Dynamic stored procedures don't close their connection when the result is not cast #69

Open
abe545 opened this issue Apr 7, 2016 · 1 comment
Assignees
Labels

Comments

@abe545
Copy link
Owner

abe545 commented Apr 7, 2016

#49 fixed the issue when the result is cast to something. However, if the results are never cast to a different object, the connection is never closed. This is a big issue for code like the following:

public async Task Call()
{
    try
    {
        await connection.ExecuteAsync().usp_Sproc();
    }
    catch (Exception ex)
    {
        Log(ex);
        throw;
    }
}
@abe545 abe545 added the bug label Apr 7, 2016
@abe545 abe545 added this to the 2.2.6 milestone Apr 9, 2016
@abe545 abe545 self-assigned this Apr 9, 2016
@abe545 abe545 modified the milestones: 2.2.6, 2.2.7 May 24, 2016
@abe545 abe545 modified the milestone: 2.3.0 Aug 25, 2016
@abe545
Copy link
Owner Author

abe545 commented Sep 2, 2016

This is unfortunately not fixable with this style of calling. How would we know when the result is no longer needed? However, developers can mitigate the issue if they use the new ExecuteNonQueryAsync (merged in #86 ):

public async Task Call()
{
    try
    {
        await connection.ExecuteNonQueryAsync().usp_Sproc();
    }
    catch (Exception ex)
    {
        Log(ex);
        throw;
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant