Re: Serializable transactions and SQLException

Поиск
Список
Период
Сортировка
От Kris Jurka
Тема Re: Serializable transactions and SQLException
Дата
Msg-id Pine.BSO.4.56.0410282111470.19094@leary.csoft.net
обсуждение исходный текст
Ответ на Serializable transactions and SQLException  (Giampaolo Tomassoni <g.tomassoni@libero.it>)
Ответы Re: Serializable transactions and SQLException  (Giampaolo Tomassoni <g.tomassoni@libero.it>)
Список pgsql-jdbc

On Thu, 28 Oct 2004, Giampaolo Tomassoni wrote:

> I would like to develop java code using the pgsql-jdbc driver on
> serializable isolated transactions. The (general) pgsql manual states
> that this, of course, may cause concurrent updating transaction failures
> to inform the client to retry the transaction as a whole.
>
> This is said to be reported by the error message:
>
>     ERROR:  Can't serialize access due to concurrent update
>
>
> Great. I want to cope with it. But what's the SQLException.getSQLState() value
> associated to this? Or is it a SQLException.getErrorCode()? Is this value
> something 'standard', in the sense that, ie., if I need to switch to Oracle
> it works fine? Is there a better way to identify 'please, retry' suggestions
> than browsing the SQLException object?

If you are connected to a >= 7.4 server getSQLState will have a value for
this error.  The best way to identify it and make sure you code works on
other database platforms is to actually write a small test case to
generate this error and grab the error code.  PG will always return
the same error code, but other databases may not use the same one and the
best way to find out is actually testing.

Kris Jurka


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

Предыдущее
От: Oliver Jowett
Дата:
Сообщение: Re: PGobject overhaul (was Re: tightening up on use of oid
Следующее
От: Kris Jurka
Дата:
Сообщение: Re: Setting up JDBC on a Windows Platform (PostgreSQL)