From: Jiří Č. <ji...@ci...> - 2015-10-06 16:46:26
|
On Tue, Oct 6, 2015, at 15:46, Геннадий Забула wrote: > I have a question about method implementation. > CleanConnectionsImpl > It cleans connections in pool. > But why _busy dictionary connections are disposed as well? > Isn't it a trouble maker for inappropriate ClearPools method users? > > We had run in a problem where currently running queries were failing > because another thread wrongly cleared all pools. It was quite > unexpected. Well, when you clear your pool and other threads are running queries you're the one responsible. :) > 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. I don't have problem throwing exception, because for valid uses it changes nothing. But might be unexpected when somebody took advantage of that behavior. -- Mgr. Jiří Činčura Independent IT Specialist |