Connection Pooling Not Releasing Connections


Author
Message
Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 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

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.

Trent Taylor
Trent Taylor
StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)StrataFrame Developer (10K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
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.
Rob Toyias
Rob Toyias
StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)
Group: Forum Members
Posts: 31, Visits: 179
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?
StrataFrame Team
S
StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K reputation)StrataFrame Developer (4.6K 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 (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 reputation)StrataFrame Beginner (37 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