Thanks. Yeah I saw the section on failover. I guess I didn't understand
that autoreconnect in the url is now used for failover to another server
rather than reconnecting to the same server. Is that what you mean? If
that's the case I can move to dbcp or something that should handle stale
connections.


-----Original Message-----
From: Mark Matthews [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 18, 2003 12:34 PM
To: Bill Ataras
Cc: [EMAIL PROTECTED]
Subject: Re: Connector/J 3.0.9 Unexpected end of input

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bill Ataras wrote:
> I upgraded to Connector/J 3.09 from 2.0.14. After some hours, the
driver
> looses it's connection and will not reconnect (despite setting
> reconnect=true). The error starts as follows below. I rollback to
2.0.14
> and everything is stable again. This is using mysql 4.0.16-standard.
Is
> connector/j 3.0x production release?

Yes, Connector/J 3.0.x is a production release. Perhaps you missed the
following information in the README that deals with the fact that
autoReconnect=true behavior has changed?

"The driver now has fail-over support. This allows the driver to
fail-over to any number
of "slave" hosts and still perform read-only queries. Fail-over only
happens when the
connection is in a autoCommit(true) state, because fail-over can not
happen reliably
when a transaction is in progress. Most good application servers and
connection pools
set autoCommit to 'true' at the end of every transaction/connection
use."

I need to re-work the docs to say that this applies to autoReconnect as
well, however, the following troubleshooting section from the README
also tells you how to handle this (and why relying on autoReconnect
might not be a good idea for most people):

"Issue:

  "I have a servlet/application that works fine for a day, and then
stops
  working overnight".

  Resolution:

  MySQL closes connections after 8 hours of inactivity. You either
  need to use a connection pool that handles stale connections or use
the
  "autoReconnect" parameter (see "USAGE AND INSTALLATION"). Also, you
should
  be catching SQLExceptions in your application and dealing with them,
rather
  than propagating them all the way until your application exits, this
is just
  good software development. MySQL Connector/J will set the SQLState
(see
  java.sql.SQLException.getSQLState() in your APIDOCS) to "08S01" when
it
  encounters network-connectivity issues during the processing of a
query.
  Your application code should then attempt to re-connect to MySQL at
this
  point."

Regards,

        -Mark
- --
Mr. Mark Matthews
MySQL AB, Software Development Manager, J2EE and Windows Platforms
Office: +1 708 557 2388
www.mysql.com

Are you MySQL Certified?
http://www.mysql.com/certification/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQE/4g9RtvXNTca6JD8RAtRGAJ9IkWznogxvmoFfFVdqtWsMMHCV0gCfYL/0
otNjauYKCQn98p5oOvM/uzo=
=NUmy
-----END PGP SIGNATURE-----




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

Reply via email to