JDBC Exception

This is a discussion on JDBC Exception within the MySQL Database forums, part of the Database Forums category; Occasionally, I'm running into the following exception, and it is starting to be a pain... SQLException: Unable to connect ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-14-2005
Rob McDonald
 
Posts: n/a
Default JDBC Exception

Occasionally, I'm running into the following exception, and it is starting
to be a pain...

SQLException: Unable to connect to any hosts due to exception:
java.net.BindException: Address already in use: connect
Exception in thread "Thread-6" java.lang.NullPointerException

I'm running two Java programs which access my database at the same time.
One program is queuing a lot of data. The other program occasionally (every
10sec unless triggered by the user) polls the database to get a list of the
data.

The queuer starts a thread to handle all the queuing. Typically, it gets
about 400 queued when the collision occurs. The queuer never requests a
list of all points, it just adds them, so its queries are relatively quick.

The poller is requesting a full list of data, so those requests are much
slower. I can limit how frequently a complete update is performed, but it
must be done occasionally. I'm afraid that a heuristic may just mask the
bug, making it harder to reproduce.

If I run the queuer alone (no competing poller), it runs great. In fact,
last night I ran two concurrent threads each queuing 10000 entries. The job
completed without any problem.

I'm running MySQL 4.0.18-nt on Windows 2000 Pro. The database and the
application are running on the same machine. I'm using
mysql-connector-java-3.0.11-stable-bin as my JDBC driver.

Thanks in advance for any pointers,

Rob


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 01:33 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0