G
Guest
Hi,
Recently, my site has been generating errors which say:
"Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached."
I'm wondering if this might have something to do with the way that we use
objectdatasource objects.
In an aspx page, we would put a gridview/dataview/whatever and bind it to an
objectdatasource.
The objectdatasource pulls data from a middle tier component which often
simply returns a sqldatareader object.
We're using the Enterprise Library's Data Access Application Block to handle
some of the data access functionality, and I believe that the DAAB
automatically sets the CommandBehavior.CloseConnection propperty.
However, because we are simply returning the datareader from the middle
tier, and passing them along to the objectdatasource on the aspx page, there
is no way (that I can think of) to call datareader.close or connection.close.
So, my question is: Does an objectdatasource close the datareader (and
connection) or is this all left open until the garbage collector comes along?
And if it is left open, is there simple way around this, or should I recode
the middle-tier to return datasets (or datatables or some other object) so
that I can close the connection manually?
thanks,
Doug
Recently, my site has been generating errors which say:
"Timeout expired. The timeout period elapsed prior to obtaining a connection
from the pool. This may have occurred because all pooled connections were in
use and max pool size was reached."
I'm wondering if this might have something to do with the way that we use
objectdatasource objects.
In an aspx page, we would put a gridview/dataview/whatever and bind it to an
objectdatasource.
The objectdatasource pulls data from a middle tier component which often
simply returns a sqldatareader object.
We're using the Enterprise Library's Data Access Application Block to handle
some of the data access functionality, and I believe that the DAAB
automatically sets the CommandBehavior.CloseConnection propperty.
However, because we are simply returning the datareader from the middle
tier, and passing them along to the objectdatasource on the aspx page, there
is no way (that I can think of) to call datareader.close or connection.close.
So, my question is: Does an objectdatasource close the datareader (and
connection) or is this all left open until the garbage collector comes along?
And if it is left open, is there simple way around this, or should I recode
the middle-tier to return datasets (or datatables or some other object) so
that I can close the connection manually?
thanks,
Doug