473,668 Members | 2,457 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.DataAcce ss.Client.Oracl eException Connection
request timed out at ...
Oracle.DataAcce ss.Client.Oracl eConnection.Ope n()
...."

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
OracleConnectio n.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.Threadi ng.ThreadAbortE xception: Thread was being
aborted. at Oracle.DataAcce ss.Client.OpsSq l.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 OracleDataReade r,
OracleCommand, OracleParameter s and OracleConnectio n 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_threa d_abort.plsql" for the stored procedure being called
against the "all_object s" table and a screenshot
"Database_Sessi ons_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 12115
Hi all, I think I have found a reason for this problem:

The problem is caused by, when the IIS server's "executionTimeo ut" 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 executionTimeou t 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
executionTimeou t 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
2829
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
2000
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 obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached." Is this indicative of a coding problem or perhaps a setting on the server? Help is appriciated
10
3159
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 connection? Is this possible over different instances of a class. For example Instance 1 of my dll is alive and creates a connection to a Database. The class goes out of scope (I have closed the connection by this stage)
2
5110
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 are using the application, we got this error: "System.Web.HttpException: Unable to connect to SQL Server session database. ---System.InvalidOperationException: Timeout expired. The timeout period elapsed prior to obtaining a connection from the...
2
9799
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 Server 2003. - The AspState DB is defined in a Sql Server 2000 DB on another server. I have added this definition to the Web.config file: <sessionState mode="SQLServer"
16
2862
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 a worker thread that would execute the db commands. The pool was fixed and all the connections were created when the db access class was instantiated. The connections remained opened during the whole execution. If a connection was not available...
20
3272
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 many connection has been used ? 2. If the maximum pool size has been reached, what happens when I call the method Open to open the connection ? Will I get an error ? MSDN says the request is queued, but will I get an error in the open method ? ...
7
2765
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 gives is: 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.
1
3419
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 returns a Connection objec to ASP page and then I am trying to use the same Connection object to Command/Recordset object to execute a SP I am getting the error given below ************************************
0
8459
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8371
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8652
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7391
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5677
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4372
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2782
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2017
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1779
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.