PostgreSQL JDBC - trouble with catching exceptions

Поиск
Список
Период
Сортировка
От Serge Dubakov
Тема PostgreSQL JDBC - trouble with catching exceptions
Дата
Msg-id 2512618274.20011217145305@tvs.rk.tusur.ru
обсуждение исходный текст
Ответы Re: PostgreSQL JDBC - trouble with catching exceptions  (Rene Pijlman <rene@lab.applinet.nl>)
Список pgsql-jdbc
Hello,

While working on a web application based on FreeBSD/Java/PostgreSQL platform, we ran
into this kind of trouble:

Some exceptions thrown by database are returned to our java code whenever they happen,
while others act very unstable:

- when we connect to database directly through JDBC driver (we tried all the latest versions),
exceptions like

  java.sql.SQLException
    message: ERROR:  fk_trans_reference_money_op referential integrity violation - key referenced from trans not found
inmoney_operation 

are NEVER caught. (they DO HAPPEN in reality for sure!)

- when we connect to database through the connection pool (we use the latest version of
PoolMan, http://www.codestudio.com), those kinds of exceptions are caught SOMETIMES.
In other cases, they may be just not be returned at all (though called stored procedure
fails!) or instead of them we get exceptions like

  org.postgresql.util.PSQLException
    message: No results were returned by the query

which is not adequate.

As a said, exceptions like

  java.sql.SQLException
    message: ERROR:  Cannot insert a duplicate key into unique index ak_key_3_account

are caught ALWAYS (with any method of database connecting).

The problems seems to be in JDBC layer. Does anyone have any ideas or suggestions?

The environment we work in is as follows:

FreeBSD 4.3
JDK 1.3.1
Resin 1.2
PostgreSQL JDBC driver 7.1-1.2
Poolman 2.1
PostgreSQL 7.1.3

--
Serge Dubakov
serge@dubakov.com
TV-System LLC




В списке pgsql-jdbc по дате отправления:

Предыдущее
От: David Brownlee
Дата:
Сообщение: Re: date problem with postgres JDBC 7.1 driver
Следующее
От: "Hunt, Bryan"
Дата:
Сообщение: