473,387 Members | 1,520 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,387 software developers and data experts.

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="someusername";
String password="somepassword";
String driver="org.gjt.mm.mysql.Driver";

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

and I close the statements, resultsets and connections with

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

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

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 1257

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

Similar topics

1
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...
1
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...
4
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...
2
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...
12
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...
37
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...
13
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...
4
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...
5
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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...
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.