"A connection pooling error has occurred." exception thrown randomly when SqlConnection.Close(). (In

F

F176

I'm making a databse management tool with VS.NET 2003 C#.
The InvalidOperationException occured RANDOMLY.

"A connection pooling error has occurred."

I'm accessing SQL server 2000 (MSDE Release A) through SqlConnection.
The database that I'm using is set as SINGLE USER by EM.
So I created one connection object and reused it repeatly.
(Connection is keeping open during application is running.)
No exception when working and running, but the exception thrown when
application closing. (Exactly, when SqlConnection.Close () method called.)

I searched ms .net newsgroup (by google), I know I have not to use
SqlConnection.Close() in any destructor routine, and my code has no
destructor at all project. (Even no "~" character on whole sources.)
I didn't call Close() method at any destructor, and Close () method is
places on Dispose() method currently.

My SqlConnection is wrapped by a component that placed on a form by the
designer.



PS.
I have to use SINGLE USER option, cause there is special reason, please
don't discuss about it.







THIS IS EXCEPTION DETAILS:

- $exception {System.InvalidOperationException}
System.InvalidOperationException
- System.SystemException {"A connection pooling error has occurred."}
System.SystemException
- System.Exception {"A connection pooling error has occurred." }
System.Exception
System.Object {System.InvalidOperationException} System.Object
_className null string
_COMPlusExceptionCode -532459699 int
_exceptionMethod <undefined value> System.Reflection.MethodBase
_exceptionMethodString null string
_helpURL null string
_HResult -2146233079 int
_innerException { } System.Exception
_message "A connection pooling error has occurred." string
_remoteStackIndex 0 int
_remoteStackTraceString null string
_source null string
+ _stackTrace {System.Array} System.Object
_stackTraceString null string
_xcode -532459699 int
_xptrs 0 int
HelpLink null string
HResult -2146233079 int
InnerException { } System.Exception
Message "A connection pooling error has occurred." string
Source "System.Data" string
StackTrace " at System.Data.SqlClient.SqlConnection.Close()\r\n at
F176.Database.Generator.Dispose()\r\n at
F176.Database.Server.Dispose()\r\n at
F176.Database.Manager.Dispose(Boolean disposing)\r\n at
System.ComponentModel.Component.Finalize()" string
+ TargetSite {System.Reflection.RuntimeMethodInfo}
System.Reflection.MethodBase
+ this {F176.Database.Generator} F176.Database.Generator
 
S

Scott Allen

If you have no option but to run in single user mode and leave a
connection open, then pooling serves no useful purpose. Perhaps add:

Pooling=false

to the connection string to disable completely.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top