DB2 ODBC inconsistent connectivity - asp.net

My ASP.net application uses ODBC(64 bit) to connect to DB2 Database(9.5.3). I am using 64 bit IBM DB2 Client 10.5. on Windows Server 2008 R2.
Connection pool is turned on.
It works fine(immediate connectivity) for most of the time, but occasionally too much time is consumed to establish connectivity. By too much time I mean to say 10 to 11 minutes. No error is reported. No issue with database, as it can be accessed from other servers at same timestamp.
All database request issued during this time via DB2 Client are kept on hold and then once connectivity is established, all are executed immediately.
When the issue is going on, I tried to connect to database through Windows server CMD and that too waits for around 10 mins. No error is reported.
Network team says they dont see network traffic from Windows server to Database server when issue is going on. And no errors from network side. Which means DB2 client is not making connectivity request.
What could be causing delay in connectivity? This is not a consistent issue. It automatically resolves after around 10 mins. Is there any issue with DB2 driver ? Was any resource withheld during that time? I am closing all connections properly.

Related

Connect to Oracle 10g through Internet using Pool

Our .Net webservice provides data for about 1000 users and 3000 request per seconds.
If it connects to a database reside on LAN, every thing is OK. But when it connects to a database through The Internet, and naturally, connection will some times not stable and it lead to dead connections. In client's connection pool, connections are still there and on the server also but they are dead already. No connection will be created after that because of full connection pool.
If that happend, we have to reset IIS :( and it happens a lot.
We are using free version of DotConnect 7.3.132.0, Oracle 10g and webservice written in .Net 2.0.
Please help :(
We move our webservice to the same LAN of DB. Every thing is fine.

classic asp IIS 7.5 sql server performance

We have been using this external program thats using classic asp, and sql server express 2008R2 on windows server 2008R2 running IIS 7.5
It has been running fine until the last month when almost each page is taking atleast 2 minutes to load. If i reboot the web server, everything works fine for the first few mins until it goes back to same old issues.
It appears that the app is resetting some setting after 2 minutes and then its able to respond. I am not sure what setting that would be.
I tried to set up failed trace request, and found that it never finished or rather the log file never capture the error. (even after increasing the log file size. I tried this multiple times)
The program is using SQL server native client 10 to talk to sql server. I have played around with connection pooling, changing the app pool from classic to integrated and vice versa. It does not seem to be a db issue, as the activity monitor does not show too much consumption and sql server wait stat that i see is ASYNC_NETWORK_IO and PREEMPTIVE_OS_WAITFORSINGLEOBJECT which relates to the fact on how the client is processing the results sent from the db server.
I am looking for suggestions on how to debug this issue. My guess has to be the way the connection from asp to sql server.
Thanks in advance.

OLE DB Provider for SQL Server works, but not SQL Native Client

I'm running out of ideas so checking if anybody can shed some light.
2 tier Client-server application
SQL Server 2005
Workstation: Windows XP
Client-Server Application 1 uses SQL OLE DB Provider. (Provider=SQLOLEDB.1)
Client-Server Application 2 uses SQL Native Client. (System.Data.SqlClient.SqlConnection)
Somehow, application 1 works well but application 2 needs to have Timeout in connection setting to be 30 seconds to make it work.
Using a tip I learned from JohnnyCoder's Database Connectivity Test with UDL File, I tracked down the problem is somewhere around driver. When I try Microsoft OLE DB Provider for SQL Server, it connects immediately. When I try SQL Native Client, it doesn't take long. It fails even it I set connection timeout to be 60.
Both of the applications work well on other installations but not on one specific site. So it has to be related to some environmental settings such as security, firewall, etc.
I tried installing new SQL Server 2005 Native Client on workstation. No luck.
So my question is:
Why does Application 2 ever make it work when the client actually cannot connect? Is there internal logic to use OLE DB when SQL Native Client timeout happens?
What else would you take a look?
Answer: their network firewall blocked TCP/IP packets.
As a result, SQL Native Client timed out with TCP/IP after 20 seconds and then tried Named Pipe which made it work.

Tracking down database connection issues

Background
We have a number of web applications on different web servers that connect to a single database server. Over the past couple months, we have noticed that every once in awhile, our web servers won't be able to connect to the database server.
Our Environment
We have a couple different web environments, some running ColdFusion and others running .NET. The .NET apps are both Web Forms and MVC. They span multiple versions from 2.0 to 4.5. Both the ColdFusion and .NET web servers are windows based machines. Both the ColdFusion and .NET web environments are clustered and some of the machines are physical while others are virtual.
Our database server is SQL Server 2008 r2. It houses multiple databases. Each application has its own database user that it connects with to the server that only gives it access to a particular database.
Other Facts
When we notice issues, they occur in short bursts that last anywhere from a couple seconds to a couple minutes.
When we notice issues, the burst contains errors from multiple different appliations, not just one app at at time.
When we notice issues, the burst contains errors from applications from different web environments. (This makes us think we can rule out that the apps themselves are the issue)
The burst of connection issues happen at various times throughout the day and night. They are not always during times of high usage.
We have monitored things like number of user connections, memory, IO, CPU usage, etc... and we have not seen spikes or anything else that might point to a problem.
We have installed wireshark on the web and db servers in hopes of catching the problem without any success.
Questions
Does anyone have suggestions on where I should look next?
Are there properties of the database that could cause this?
Is there any way to "monitor" the connection between the database and web server in a better manner?
Is there anything that can be done on the app side to better understand what is happening?
Errors Caught by Apps
.NET errors
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: Named Pipes Provider, error: 40 - Could not open a connection to SQL Server)
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
A transport-level error has occurred when receiving results from the server. (provider: TCP Provider, error: 0 - The semaphore timeout period has expired.)
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.
ColdFusion errors
Error Executing Database Query. The TCP/IP connection to the host has failed. java.net.ConnectException: Connection timed out: connect The error occurred on line 38.
Error Executing Database Query. Connection reset by peer: socket write error The error occurred on line 91.
Error Executing Database Query. Timed out trying to establish connection The error occurred on line 38.
In CF, I once had an issue like what you were seeing. I had CF on 1 server, and sql 2008 r2 on another server. I would see CF errors like you posted below. To help trace it to a network error I wrote something like this:
1) created a down.bat
tracert serverip
2) I then put a <cftry><cfcatch> around the query.
When the query generated the error I would execute
<cfexecute name="C:\path\to\down.bat" variable="log" timeout="60" />
<cfmail to="ME" from="Server" subject="SQL DOWN">
Server Debugging Info:
------------------------------------------------------------
#now()#
#cfcatch.Detail#
#cfcatch.Message#
#log#
</cfmail>
</cfexecute>
This helped me fix my situation which ended up being hardware at the datacenter.

Computer/Application having trouble and getting slow while accessing Sql server through LAN, Network is fine

I have an web project in asp.net in one of my computers which are connected internally through LAN. The database is in Sql Server kept in another computer. The LAN is connected well. There is no connection error in my programming also. But sometimes in this particular system the page is taking long time to be open, sometime it is showing some exceptions(not everytime again and again). What can be the problem? How can it be solved?
The same project is running good in other computers as well.
My network seems ok, as I can acccess the computer hosting SQL server.
You're just having connection problems.
The page waits for the SQL query's answer to return, and it won't load until it gets the answer.
Check your LAN's connection by pinging between the computer with the project and the SQL server.
If this really is the problem, then the exceptions are probably time-outs.

Resources