Re: Big Crash
Posted by: Mark Matthews
Date: February 24, 2005 05:34PM

Jason Winnebeck wrote:
> Doesn't the Connector/J Driver have an
> auto-reconnect functionality for cases like these?
> Of course the server can be down for a long time,
> but you seem to imply that any proper execution of
> a SQL statement should be in a loop until it
> succeeds (or you give up).


autoReconnect is there, but can only handle very limited failure scenarios. I myself would only use it for read-only applications, as if you're changing data, you want to make sure things happen in exactly the order you think they do, and that the database (as far as your application is concerned) goes from one known state to another.

If you handle exceptions incorrectly in your application, and at the same time, 'autoReconnect=true' could fool your app into thinking a connection (and thus a transaction) has been in place the entire time, thus leaving your application thinking it's working with one version of the data (before the connection died, and the transaction up to that point was rolled back by MySQL), while something different exists in the database.


Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools

Options: ReplyQuote

Written By
February 24, 2005 10:04AM
February 24, 2005 11:23AM
February 24, 2005 02:19PM
February 24, 2005 02:33PM
Re: Big Crash
February 24, 2005 05:34PM
February 25, 2005 01:36AM
February 25, 2005 11:04AM
February 25, 2005 11:51PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.