Connection Pooling Not Releasing Connections


Author
Message
Rob Toyias
Rob Toyias
StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)
Group: Forum Members
Posts: 31, Visits: 179


Were working on a web app with an Oracle backend and were seeing some strange behavior.



Connections to the database are not being dropped. Is there something were supposed to call to end the connection at the end of the page request?



We can see this issue by implementing the following pseudo code.



protected void Page_Load(object sender, EventArgs e)

{

BusinessObject1.FillAll();

}

protected void SaveButton_Click(object sender, EventArgs e)

{

BusinessObject2.FillAll();

BusinessObject3.FillAll();

BusinessObject4.FillAll();

}



Now watching the database connections one connection gets created on page load. The SQL that gets called is the SQL that is defined in my FillAll() method.



When I click my SaveButton and fire the Click event I see another connection in the database, this one executes three SQL statements, the ones detailed in BO2, BO3, and BO4 FillAll() methods.



The problem is that my connections never go away. If I refresh the page I get 2 more connections, and they never go away either.



What have I missed?



Thanks

Replies
StrataFrame Team
S
StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)StrataFrame Developer (6.5K reputation)
Group: StrataFrame Developers
Posts: 3K, Visits: 2.5K
Have you explicitly turned off connection pooling in your connection string?  If you don't explicitly turn it off, then the ADO.NET Oracle provider will not explicitly close connections (even if you call OracleConnection.Close()).  We use the OracleDataAdapter class to open and close the connections for us when filling a DataTable, so it is out of our control unless you turn off the connection pooling.  Once a connection is garbage collected, it will be returned to the pool to be reused.
Rob Toyias
Rob Toyias
StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)StrataFrame Beginner (47 reputation)
Group: Forum Members
Posts: 31, Visits: 179
Ben and Trent,



That was the issue exactly! Thanks for the fix.
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search