Re: prepare() method error

Поиск
Список
Период
Сортировка
От Heikki Linnakangas
Тема Re: prepare() method error
Дата
Msg-id Pine.OSF.4.61.0602121957130.244416@kosh.hut.fi
обсуждение исходный текст
Ответ на Re: prepare() method error  (Heikki Linnakangas <hlinnaka@iki.fi>)
Список pgsql-jdbc
On Sun, 12 Feb 2006, Heikki Linnakangas wrote:

> On Sun, 12 Feb 2006, Michael Allman wrote:
>>
>> It would be cleaner if the driver could determine the success/failure of
>> the PREPARE TRANSACTION statement from the query itself.  For instance,
>> have the executeUpdate("PREPARE TRANSACTION " ....) return normally if and
>> only if it actually prepares a transaction.  If it doesn't prepare, throw a
>> meaningful SQLException.
>
> We can check the command status string. PREPARE TRANSACTION should return
> "PREPARE TRANSACTION" command status on success and "ROLLBACK" on failure.

And that's what I did, see attached patch. I had to add quite a few
imports to PGXAConnection so that it can work on the lower level and check
the command status coming from the server.

Michael: Does it now look OK to you?

It just occured to me that we have the same problem with regular commit,
don't we? If the transaction has failed, commit doesn't throw an
exception. I'm not sure if it should. The java.sql javadoc doesn't
explicitly say so, but IMHO it should.

- Heikki

Вложения

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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: prepare() method error
Следующее
От: TNO
Дата:
Сообщение: Re: Pb with Spring & Metadat