Re: Detecting 'socket errors' - closing the Connection object
От | Oliver Jowett |
---|---|
Тема | Re: Detecting 'socket errors' - closing the Connection object |
Дата | |
Msg-id | 20030723001424.GE31669@opencloud.com обсуждение исходный текст |
Ответ на | Re: Detecting 'socket errors' - closing the Connection object ("David Wall" <d.wall@computer.org>) |
Список | pgsql-jdbc |
On Tue, Jul 22, 2003 at 10:15:25AM -0700, David Wall wrote: > > > > Retrieves whether this Connection object has been closed. A connection > is > > > > closed if the method close has been called on it or if certain fatal > > > > errors have occurred. > > Precisely. This makes PERFECT sense to me. It's those fatal errors that > should allow us to detect something has gone wrong and therefore should not > be retried. If the JDBC Connection gets an I/O exception, it could easily > close itself. I suspect I could add that code to the Postgresql JDBC > library myself quite easily. The unfortunate situation, though, is that > other JDBC libraries may or may not do it, so therefore it's an unreliable > bit of code, and Dmitry's hack comes back into play as perhaps the only > reliable solution with the current state of affairs among JDBC > implementations. I know for sure that Oracle does not close itself. Have you looked at the ConnectionEventListener approach? I know that it's not currently implemented in postgresql, but it should be easy enough to add, and in theory this is the standard way of doing it. -O
В списке pgsql-jdbc по дате отправления: