Dudes & Dudetts

filter: mysql, select, sql
mysql version: 3.23.49
jdbc version: 2.0.14
development os: win2k
production os: solaris

Problem:
--------
During a reboot of mysqld, the perl connections survived
and the jdbc connections did not. My definition of survived is 
that the connections waited until mysqld rebooted and automatically
reconnected.

Discussion
----------

None of the jdbc connections survived. Back to the books I went.
I did not have the properties that control this behavior:
  autoReconnect, maxReconnects, initialTimeout

I changed my url + db + properties to:
jdbc:mysql://localhost/db1?user=david&passward=secret&\
autoReconnect=true&maxReconnects=5&initialTimeout=10

(The trailing backslash is simply for ledgability - not in code)

I believe this translates to: 
  If connection is lost, keep trying 5 times and wait 10 seconds
  between retrys.

Result:
-------

If I start a test application program which simply selects a 
bunch of records from a local mysql db and writes them to a file, 
then terminate the mysqld in the middle of the program, 
I get this exception:

  Error: findFeature
  java.sql.SQLException: null: Server shutdown in progress

If I start the application program with mysqld not running, I get
this exception:

  java.sql.SQLException: 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.ConnectException)

Question:
----------
How can I automatically keep my application program running without
getting exceptions?

Confused as usual

David


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to