StrataFrame Forum

Connection Pooling Not Releasing Connections

http://forum.strataframe.net/Topic11913.aspx

By Rob Toyias - 10/8/2007



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
By Trent L. Taylor - 10/8/2007

Rob,

This may explain some of your other problems as well.  StrataFrame does not keep connections open to the database at all.  It is only open long enough to execute the query and then we explicitly close the connection.  We are still in the process of getting our Oracle server restored (we rebuilt our server where Oracle previously resided), so I cannot immediately test this.  But it sounds as though there is something else in the mix here.

What is your setup (OS, Service Packs, layout, etc)? Thanks.

By Trent L. Taylor - 10/8/2007

It could have something to do with your IIS and application pooling, so the more detail you can give on your server setup the more it would help.  Thanks.
By Rob Toyias - 10/8/2007

Trent,



We are using the following two systems:



DB SERVER

Windows Server 2003 32 bit standard edition SP 2

Oracle Server 10.2.0.3 32 bit



APP SERVER

Windows Server 2003 32 bit standard edition SP 2

Oracle Client 10.2.0.3 32 bit



It's the standard web server scenario, web server talks to db server. Both are in the same facility (physically right next to each other).



this enough info, or is there more you'd like?
By StrataFrame Team - 10/8/2007

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.
By Rob Toyias - 10/8/2007

Ben and Trent,



That was the issue exactly! Thanks for the fix.