Re: Big Crash
Posted by: Mark Matthews
Date: February 24, 2005 02:19PM

E M wrote:
> BTW I am using JDK 1.4.2 and Windows 2000 server.
> I am using one connection that I open when the
> application starts. Does a connection auto-close
> after a certain amount of time? What should I do
> about it? I want a connection that 'persists' on
> an online server for years.


Forget that notion, it's not how things work with a client-server database. You need to be prepared for the connection to die by handling SQLExceptions, and re-trying your operation after getting a new connection (when appropriate).

There's nothing a database driver can do about connectivity going away that doesn't have a ton of caveats, unless you really don't care about the correctness of your data.

I noticed from your stacktrace that you're not closing a connection when your application exits (the finalizer is closing it). Any reason you're doing that?


Mark Matthews
Consulting Member Technical Staff - MySQL Enterprise Tools

Options: ReplyQuote

Written By
February 24, 2005 10:04AM
February 24, 2005 11:23AM
Re: Big Crash
February 24, 2005 02:19PM
February 24, 2005 02:33PM
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.