Issue Details (XML | Word | Printable)

Key: DNET-638
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Jiri Cincura
Reporter: Hennadii Zabula
Votes: 2
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
.NET Data provider

Clean only idle connections from pool #breaking

Created: 07/Oct/15 07:34 AM   Updated: 06/Jun/18 11:48 AM
Component/s: ADO.NET Provider
Affects Version/s: 4.9.0.0
Fix Version/s: 6.0.0.0


 Description  « Hide
We had run in a problem where currently running queries were failing because another thread wrongly cleared all pools. It was quite unexpected.

We fixed the issue in our code with the thread, but I think it should throw InvalidOperationException if _busy dictionary is not empty, because it means that there may be currently running queries.

The exception could add information about the problems caused by an inappropriate call to ClearPool.


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Jiri Cincura added a comment - 14/Jul/17 11:48 AM - edited
What I have in my head right now:

1. Clean only idle connections.
2. Throw exception if there's busy connection.
3. Provide overload for ClearPool, like force=true (or maybe the other way around).

I checked mysql-connector-net and Npgsql and both clean only idle connections and none has any "force" overload. Clearly 2 is out. Others are doing 1, so I don't see much value in 3.

Hennadii Zabula added a comment - 18/Jul/17 10:37 AM
> 1. Clean only idle connections.
Yep, that's will be sufficient.