473,379 Members | 1,355 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

ODP .Net Connection Pool Problem on Web Application

Hi Developers,

I am a .Net developer of a Large Online Retailling Company. I would
like to have your help on a Connection Pool issue.

Recently we have developed a Web Application on ODP .Net to work with
Oracle Database 10g. To gain the performance, connection pool enable is
a must. Everything work fine throughout the development period and the
performance is Great, however while the Web Application is deployed to
the production, sooner or later (a few minutes or a few days) all the
Connections in the connection pool will be unavailable and the ODP .NET
keeps throwing:

"The Exception: Oracle.DataAccess.Client.OracleException Connection
request timed out at ...
Oracle.DataAccess.Client.OracleConnection.Open()
...."

It seems to me that all the Connections in the Connection Pool are
busy, as a result once the "Connection timeout" period is over, the
OracleConnection.Open() throws this Exception.

However, when I look into the sessions information at the Database, all
the Sessions (Max Pool Size=40, for instance) are in Wait Events -
SQL*Net message from client for a long long time.

I can just find a reason for this: In the Web Application, every
concurrent incoming requests is handled by a separating thread
concurrently. For some pages, it may hit a long query in the database.
For some reason, those pages will be Timeout and IIS 6.0 will call
"Thread.Abort()" to stop the corresponding thread. I can catch
Exception "System.Threading.ThreadAbortException: Thread was being
aborted. at Oracle.DataAccess.Client.OpsSql.ExecuteReader( ... " at the
DataAccess Layer.

To reproduce the problem in a simplier program, I have created a
long-running query aginst the all_objects table in DB and started 20
threads for it. At the middle of each Thread Executing, I issue the
Thread.Abort(). After all threads are aborted and all OracleDataReader,
OracleCommand, OracleParameters and OracleConnection are disposed in
the finally block, I tried to run the query but it will fail to obtain
a connection from the connection pool.

If I set "pooling = false", there will be no problem.

The testing program can be downloaded at:
http://ki-gallery.dyndns.org/downloa...dAbortTest.zip

in which there are a .Net solution, a plsql script
"pkg_test_thread_abort.plsql" for the stored procedure being called
against the "all_objects" table and a screenshot
"Database_Sessions_Status.jpg" about the idle sessions in the database.
Please try to use Anti-Virus program to scan the zip package :)

I thank you for your help !

Regards,
Alex

Feb 13 '06 #1
1 12033
Hi all, I think I have found a reason for this problem:

The problem is caused by, when the IIS server's "executionTimeout" for
httpRequest is reached, IIS will call Thread.Abort() to stop the
processing thread for the Request.

For instance, If a web page is requested, meanwhile the database is
very busy, the Database can't return all the result to the web
application within 40 sec (the default value of executionTimeout in
machine.config), this thread will be aborted!

I have just read the Release note of ODP .NET 10.2.0.1.0, in the
section "TIPS, LIMITATIONS AND KNOWN ISSUES", it says:

8. Thread.Abort() should not be used, as unmanaged resources may remain
unreleased properly, which can potentially cause memory leaks and
hangs.
It seems that we can just avoid the problem by setting the
executionTimeout value to a reasonablily large value. However, this
will greatly affect the web server performance as some Threads will be
hold and they are not able to serve other requests.

Please advise!

Regards,
Alex

Feb 15 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mithun Verma | last post by:
Hello All, I am working on a windows application which will talk to the database through the Web services. So i need to enhaance the performance, for which i m using connection
3
by: LRK | last post by:
I am in the process of moving an ASP.NET app from my development machine to a web server. I am getting the following error message: Message: "Timeout expired. The timeout period elapsed prior to...
10
by: Steven Blair | last post by:
As I understand it, if I create a connection object in my application and close the connection, the next time I open a connection with the same connection string I should be using a pooled...
2
by: RyoSaeba | last post by:
Hello, I have a problem with the session state set to Sql Server (AspNet 1.1, Windows Server 2003 on an Application Center cluster, Sql Server 2000 on another server). Sometimes, when many user...
2
by: JoeSep | last post by:
Hi! Is it correct/safe to define a connection pool in the string "sqlConnectionString" of the "sessionState" section of Web.config? - The application is developed using AspNet 1.1 in a Windows...
16
by: crbd98 | last post by:
Hello All, Some time ago, I implemented a data access layer that included a simple connectin pool. At the time, I did it all by myself: I created N connections, each connection associated with...
20
by: fniles | last post by:
I am using VS2003 and connecting to MS Access database. When using a connection pooling (every time I open the OLEDBCONNECTION I use the exact matching connection string), 1. how can I know how...
7
by: =?Utf-8?B?Sm9obiBTdGFnZ3M=?= | last post by:
Hello, Please read this all before giving an answer :) I'm doing some troubleshooting on a web application that my company wrote. It's written in asp.net 1.1. The error that the Event viewer...
1
by: =?Utf-8?B?VmVua2F0ZXNhbiBT?= | last post by:
Hi, I have a requirement of consuming a connection object returned from a COM component deployed in COM+ application. I have given the need for this requirement end of my query. My component...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.