Re: connections from a data access class never get closed
Posted by: Gianluca Ippolito
Date: January 13, 2005 12:29PM

Hi David

I get the same result also if don't call .Close() on the method.

I've seen this logic implented ( a component layer that expose a method returning a datareader), in the Asp.Net Commerce Starter Kit. In this application readers returned from component layer object methods are bound to server controls and they are never explicitly closed.

have a look to the productlist.aspx page

http://asp.net/CommerceStarterKit/SourceViewer/srcview.aspx?path=productslist.src&file=ProductsListPage&rows=5

and to the ProductsDb.cs module

http://asp.net/CommerceStarterKit/SourceViewer/srcview.aspx?path=productslist.src&file=ProductsListPage&rows=5

The CommandBehavior.CloseConnection reference says that "When the command is executed, the associated Connection object is closed when the associated DataReader object is closed."
This i the reason why i tried to call .Close() on the method. But what i'm getting is always an increasing number of connection until i reach the max pool size.

I know that Commerce the starter kit uses stored procedures but i think taht the component layer logic should work also with text commands.

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.