I am trying to clean an object in its Finalize method regarrding connection
pbjects as follows :
objConnection.Dispose()
objConnection = Nothing
shCard = Nothing
The connection iscreated in another object as follows
objConnection = shCard.CreateConnection

I get the following error on the line "objConnection.Dispose() or
objConnection.close
***************************************
{System.InvalidOperationException}
[System.InvalidOperationException]: {System.InvalidOperationException}
HelpLink: Nothing
InnerException: Nothing
Message: "A connection pooling error has occurred."
Source: "System.Data"
StackTrace: " at System.Data.SqlClient.SqlConnection.Close()
at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)
at System.ComponentModel.Component.Dispose()
at ConfigBAL.ShoppingCartDB.Finalize() in
C:\Inetpub\wwwroot\Configurator\Components\ShoppingCartDB.vb:line 977"
TargetSite: {System.Reflection.RuntimeMethodInfo}
*********************************************
Does that mean that I can not close or dispose a connection object because
of pooling
As I said in a previeou post, I have user connections depassing the default,
which I think is 100 by default
Thanks

Re: A connection pooling error has occurred by Thomas

Thomas
Sun Oct 01 14:49:33 CDT 2006

Salam

It seems that you made the same error as described in another post. (Closing/Disposing the method in the destructor). Search for "A connection pooling error has occurred" in google groups and you will find the message.

Good luck
Thomas

On Sun, 1 Oct 2006 11:29:01 -0700
SalamElias <eliassal@online.nospam> wrote:

> I am trying to clean an object in its Finalize method regarrding connection
> pbjects as follows :
> objConnection.Dispose()
> objConnection = Nothing
> shCard = Nothing
> The connection iscreated in another object as follows
> objConnection = shCard.CreateConnection
>
> I get the following error on the line "objConnection.Dispose() or
> objConnection.close
> ***************************************
> {System.InvalidOperationException}
> [System.InvalidOperationException]: {System.InvalidOperationException}
> HelpLink: Nothing
> InnerException: Nothing
> Message: "A connection pooling error has occurred."
> Source: "System.Data"
> StackTrace: " at System.Data.SqlClient.SqlConnection.Close()
> at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)
> at System.ComponentModel.Component.Dispose()
> at ConfigBAL.ShoppingCartDB.Finalize() in
> C:\Inetpub\wwwroot\Configurator\Components\ShoppingCartDB.vb:line 977"
> TargetSite: {System.Reflection.RuntimeMethodInfo}
> *********************************************
> Does that mean that I can not close or dispose a connection object because
> of pooling
> As I said in a previeou post, I have user connections depassing the default,
> which I think is 100 by default
> Thanks

Re: A connection pooling error has occurred by eliassal

eliassal
Sun Oct 01 15:44:01 CDT 2006

Thanks, I typed the phrase in google but really just 2 iems dispalyed which
Ithinkare not relevant tothe subject. If you have a URL or msdn item,please
let me know
Thanks again

"Thomas Weingartner" wrote:

> Salam
>
> It seems that you made the same error as described in another post. (Closing/Disposing the method in the destructor). Search for "A connection pooling error has occurred" in google groups and you will find the message.
>
> Good luck
> Thomas
>
> On Sun, 1 Oct 2006 11:29:01 -0700
> SalamElias <eliassal@online.nospam> wrote:
>
> > I am trying to clean an object in its Finalize method regarrding connection
> > pbjects as follows :
> > objConnection.Dispose()
> > objConnection = Nothing
> > shCard = Nothing
> > The connection iscreated in another object as follows
> > objConnection = shCard.CreateConnection
> >
> > I get the following error on the line "objConnection.Dispose() or
> > objConnection.close
> > ***************************************
> > {System.InvalidOperationException}
> > [System.InvalidOperationException]: {System.InvalidOperationException}
> > HelpLink: Nothing
> > InnerException: Nothing
> > Message: "A connection pooling error has occurred."
> > Source: "System.Data"
> > StackTrace: " at System.Data.SqlClient.SqlConnection.Close()
> > at System.Data.SqlClient.SqlConnection.Dispose(Boolean disposing)
> > at System.ComponentModel.Component.Dispose()
> > at ConfigBAL.ShoppingCartDB.Finalize() in
> > C:\Inetpub\wwwroot\Configurator\Components\ShoppingCartDB.vb:line 977"
> > TargetSite: {System.Reflection.RuntimeMethodInfo}
> > *********************************************
> > Does that mean that I can not close or dispose a connection object because
> > of pooling
> > As I said in a previeou post, I have user connections depassing the default,
> > which I think is 100 by default
> > Thanks
>

Re: A connection pooling error has occurred by v-kevy

v-kevy
Sun Oct 01 23:08:58 CDT 2006

Hi Salam,

We cannot call Close or Dispose on a Connection, a DataReader, or any other
managed object in the Finalize method of your class. In a finalizer, only
release unmanaged resources that your class owns directly. If your class
does not own any unmanaged resources, do not include a Finalize method in
your class definition.

Actually, you only need to call objConnection.Close when you have finished
using it. The connection object itself will take care of releasing the
unmanaged resources.

For more information, please check the following link:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconconnectionpoolingforsqlservernetdataprovider.asp

Kevin Yu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================

(This posting is provided "AS IS", with no warranties, and confers no
rights.)


Re: A connection pooling error has occurred by Thomas

Thomas
Mon Oct 02 07:21:10 CDT 2006

Thanks Kevin for the clear answer.

For completness here the link I found with the same answer as Kevin wrote.

http://groups.google.ch/group/microsoft.public.dotnet.framework.adonet/browse_frm/thread/c089268a78893631/69ea763ef1b84bae?lnk=st&q=A+connection+pooling+error+has+occurred&rnum=3#69ea763ef1b84bae

Thomas

Kevin Yu [MSFT] wrote:
> Hi Salam,
>
> We cannot call Close or Dispose on a Connection, a DataReader, or any other
> managed object in the Finalize method of your class. In a finalizer, only
> release unmanaged resources that your class owns directly. If your class
> does not own any unmanaged resources, do not include a Finalize method in
> your class definition.
>
> Actually, you only need to call objConnection.Close when you have finished
> using it. The connection object itself will take care of releasing the
> unmanaged resources.
>
> For more information, please check the following link:
>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> l/cpconconnectionpoolingforsqlservernetdataprovider.asp
>
> Kevin Yu
> Microsoft Online Community Support
>
> ==================================================
> Get notification to my posts through email? Please refer to
> http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> ications.
> Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> where an initial response from the community or a Microsoft Support
> Engineer within 1 business day is acceptable. Please note that each follow
> up response may take approximately 2 business days as the support
> professional working with you may need further investigation to reach the
> most efficient resolution. The offering is not appropriate for situations
> that require urgent, real-time or phone-based interactions or complex
> project analysis and dump analysis issues. Issues of this nature are best
> handled working with a dedicated Microsoft Support Engineer by contacting
> Microsoft Customer Support Services (CSS) at
> http://msdn.microsoft.com/subscriptions/support/default.aspx.
> ==================================================
>
> (This posting is provided "AS IS", with no warranties, and confers no
> rights.)
>

Re: A connection pooling error has occurred by eliassal

eliassal
Mon Oct 02 16:07:01 CDT 2006

thanks for all of you.

"Thomas Weingartner" wrote:

> Thanks Kevin for the clear answer.
>
> For completness here the link I found with the same answer as Kevin wrote.
>
> http://groups.google.ch/group/microsoft.public.dotnet.framework.adonet/browse_frm/thread/c089268a78893631/69ea763ef1b84bae?lnk=st&q=A+connection+pooling+error+has+occurred&rnum=3#69ea763ef1b84bae
>
> Thomas
>
> Kevin Yu [MSFT] wrote:
> > Hi Salam,
> >
> > We cannot call Close or Dispose on a Connection, a DataReader, or any other
> > managed object in the Finalize method of your class. In a finalizer, only
> > release unmanaged resources that your class owns directly. If your class
> > does not own any unmanaged resources, do not include a Finalize method in
> > your class definition.
> >
> > Actually, you only need to call objConnection.Close when you have finished
> > using it. The connection object itself will take care of releasing the
> > unmanaged resources.
> >
> > For more information, please check the following link:
> >
> > http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
> > l/cpconconnectionpoolingforsqlservernetdataprovider.asp
> >
> > Kevin Yu
> > Microsoft Online Community Support
> >
> > ==================================================
> > Get notification to my posts through email? Please refer to
> > http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
> > ications.
> > Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
> > where an initial response from the community or a Microsoft Support
> > Engineer within 1 business day is acceptable. Please note that each follow
> > up response may take approximately 2 business days as the support
> > professional working with you may need further investigation to reach the
> > most efficient resolution. The offering is not appropriate for situations
> > that require urgent, real-time or phone-based interactions or complex
> > project analysis and dump analysis issues. Issues of this nature are best
> > handled working with a dedicated Microsoft Support Engineer by contacting
> > Microsoft Customer Support Services (CSS) at
> > http://msdn.microsoft.com/subscriptions/support/default.aspx.
> > ==================================================
> >
> > (This posting is provided "AS IS", with no warranties, and confers no
> > rights.)
> >
>