473,765 Members | 2,010 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

connections aren't released?

Hello,

I am having some performance difficulties due to the number of
connections getting so high. I know that the correct way to solve this
is by using connection pooling, but for now I can't figure out why the
connections are'nt being released as I expect.

I am using Tomcat 4.0, with mm.mysql-2.0.14-bin.jar on Linux 7.2 to
connect to a MySQL max 3.23.51 database. I open the connections in a
bean with:
private void connect () {

String url="jdbc:mysql ://mysqlserver/database";

String username="someu sername";
String password="somep assword";
String driver="org.gjt .mm.mysql.Drive r";

try {
// load db driver
Class.forName (driver);
// establish net connection to db
this.connection =DriverManager. getConnection (url, username,
password);
} catch (ClassNotFoundE xception cnfe) {
System.err.prin tln ("Error loading driver: " + cnfe);
} catch (SQLException sqle) {
System.err.prin tln ("Error connection: " + sqle);
}
}
public Connection getConnection () {
if (this.connectio n==null) {
this.connect ();
}
return this.connection ;
}

and I close the statements, resultsets and connections with

statement.close ();
rs.close();
and connection.clos e;

But when I track "Threads_connec ted" with "show status", I see that the
connections aren't released until the session is terminated with
session.invalid ate();

Any insights?

Thanks,

Bill
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/my***********...ie.nctu.edu.tw

Jul 19 '05 #1
0 1267

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

Similar topics

1
434
by: J. Dudgeon | last post by:
Hello, I've written a server that acts as a proxy between the PC and the mainframe worlds. This server service is writting in C# w/.NET 1.1. The service is TCP/IP based and makes heavy use of sockets. The "client" to the service is a C# class library that also uses sockets. I've managed to get the performance of the service up to a decent speed but I've hit a strange problem.
1
3404
by: hananiel | last post by:
Hello: We have a a two tier application connecting to sql server through remoting. The business objects are single call objects. We are opening and closing connections using ADO.NET command object. All "ExecuteNonQuery" are closed in finally blocks. We are running out of sql connections because the profiler shows that connections are not being released till the business service is stopped and restarted. Does anyone have suggestions on how...
4
6312
by: pardhi a via SQLMonster.com | last post by:
Hi I am a dba for sql server recently we are facing problems with the no of connections. we have a database called ( x ) every day almost million users is using that databse after some time the cpu showing 100 percent utilization an error throwing like odbc error connection so in that case no one is able to connect to the server.when we pause it then restart the server for some time it looks good then again it will go to 100 %...
2
2125
by: Bob | last post by:
We have a production web site that's data intensive (save user input to DB and query for displaying) with the ASP.NET app part on one W2K server and SQL 2000 DB on another W2K server. I have set up performance logs to log # of pooled database connections on the web server every 60 seconds (.NET CLR Data(_global_)\SqlClient: Current # pooled connections). The # of connections is constantly higher than the # of active ASP.NET sessions....
12
3981
by: Peter Eisentraut | last post by:
Is there any practical limit on the number of parallel connections that a PostgreSQL server can service? We're in the process of setting up a system that will require up to 10000 connections open in parallel. The query load is not the problem, but we're wondering about the number of connections. Does anyone have experience with these kinds of numbers? ---------------------------(end of broadcast)--------------------------- TIP 1:...
37
3986
by: Joshua Ruppert | last post by:
When I'm using FastCGI do I need to code differently than I do when using regular CGI? Because the PHP.exe processes don't go away do global variables stick around from page request to page request, creating the need for better managment / pooling of DB connections? Josh
13
1770
by: PRP | last post by:
Hi, Our DBA has complained about the large number of connections from the aspnet_wp process. We have multiple web applications deployed in different virtual directories. I read that the way ADO.NET in-built connection pool works is per app domain. So in a scenario where I am using single connection string (from web.config) and I am closing all connections as recommended, is it correct to assume that ideal number of connections
4
4691
by: Mike | last post by:
Assume i have a db connection and a datareader for that connection. Now I perform a query that retrieves 100MB of data. I know that the data reader gets 1 row at a time. However, there is a result set out there that is 100MB is size. If I close the dataReader but keep the DB connection open, will the 100MB be freed up after closing the DataReader? Can I continue reusing the same DB connection and creating and destroying datareaders...
5
3398
by: Usman Jamil | last post by:
Hi I've a class that creates a connection to a database, gets and loop on a dataset given a query and then close the connection. When I use netstat viewer to see if there is any connection open left, I always see that there are 2 connections open and in "ESTABLISHED" state. Here is the piece of code that I'm using, please tell where I'm doing it wrong. Since this class is being used at many placed in my actual web based application that...
0
9568
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
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9959
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9835
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
8833
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...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
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
5277
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.