Forums Register Login

MySql Lost connection exception under load

+Pie Number of slices to send: Send
Has anyone ever encountered a problem where JBoss begins to through exceptions under load. Basically, I have a MySql database. I can connect to it, query and update it just find. I have about 6,000 records in the database. Here is the basic loop.
con = DBUtil.getConnection();
ps = con.prepareStatement(query);
rs = ps.executeQuery();
boolean hasPatients = rs.next();
if (hasPatients)
{
do
{
myDataObj.setLocation(rs.getString("LOCATION"));
.
.
.
while (rs.getnext());
myArray.add(myDataObj)
}
I return the array and the JSP loops through the array and displays the information. It works fine when there are only 100 or so records in the result set. If I set the query statemt to something like "select * from table" it runs for a few seconds and then I start to get the following message in the JBoss command windows:
13:42:57,685 INFO [STDOUT] SqlError encountered; couldn't close connection obje
ct.java.lang.NullPointerException
13:42:57,685 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is
there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
If I let the application just sit for a while I can query again (with something other then "select *").
MySql is up and running. Like I said it only happens when I try to retrieve a large result set. If there are limit to the resultset?
Any help would be appreciated.
JT
+Pie Number of slices to send: Send
I ran some more test and have some more information that may help someone that knows about this. There are 5727 records and when the list does display it displays all of the records. I still have tons of exception messages though. Some of the errors mention that a field that I am trying to retrieve is in use and others that the connection may be lost. So many messages scroll by that I don't have them all.
Any ideas anybody?
14:01:17,547 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
14:01:17,547 INFO [STDOUT] SqlError encountered; couldn't close connection object.java.lang.NullPointerException
14:01:17,547 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
14:01:17,547 INFO [STDOUT] SqlError encountered; couldn't close connection object.java.lang.NullPointerException
14:01:17,547 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
14:01:17,557 INFO [STDOUT] SqlError encountered; couldn't close connection object.java.lang.NullPointerException
14:01:17,557 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
14:01:17,557 INFO [STDOUT] SqlError encountered; couldn't close connection object.java.lang.NullPointerException
14:01:17,557 INFO [STDOUT] Cannot connect to MySQL server on localhost:3306. Is there a MySQL server running on the machine/port you are trying to connect to?
(java.net.BindException)
14:01:17,557 INFO [STDOUT] SqlError encountered; couldn't close connection object.java.lang.NullPointerException
+Pie Number of slices to send: Send
It almost seems like this problem might be on the MySQL server side, rather than in your JBoss environment. Check the documentation for the version and mode of MySQL that you are running and see if you need to tune it differently for larger queries.
WARNING: this was just a guess.
+Pie Number of slices to send: Send
Thanks! I'll look into that. In the mean time I restructured some things so that I can load as little as possible and that seems to have alleviated the problem but you're right. 6,000 records isn't all that much of a load and shouldn't be causing a problem.
+Pie Number of slices to send: Send
Under much greater loads than what you seem to be using, I have had problems using MySQL. We set the MySQL server process to a higher priority and had much greater success, but we were still able to cause a failure if we hit it hard enough.
The problem was much as you described. We were disappointed.
So, apparently I'm not really offering any help - just sympathy.
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2023 times.
Similar Threads
3 days stucked - NullPointer Persistent Unit no Caused By
Running application on web start
P6spy does not create spy.log for stand-alone Java program
JNDI error message
EJB deployment error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 05:03:49.