Re: Would preparing internally during XAResource.end(xid, TMSUCCESS) works?

Поиск
Список
Период
Сортировка
От Dave Cramer
Тема Re: Would preparing internally during XAResource.end(xid, TMSUCCESS) works?
Дата
Msg-id CADK3HH+F6AxVp-Z0qtiK8sc1vC7ekuprria_kzTcUg0yBfGzrA@mail.gmail.com
обсуждение исходный текст
Ответ на Would preparing internally during XAResource.end(xid, TMSUCCESS) works?  (Andy Fan <zhihui.fan1213@gmail.com>)
Ответы Re: Would preparing internally during XAResource.end(xid, TMSUCCESS) works?  (Andy Fan <zhihui.fan1213@gmail.com>)
Список pgsql-jdbc
Hi Andy,

Sorry I'm not much help here.

Were you able to figure this out?

Dave Cramer


On Sat, 26 Nov 2022 at 07:03, Andy Fan <zhihui.fan1213@gmail.com> wrote:
Hi:

One of our customers is coming from Oracle and they use XAResource like
this.

xaResource1.start(xid, ..);
xaResource1.getConnection.doSomeDML();
xaResource1.end(xid, TMSUCCESS);

xaResource2.prepare(xid);

This works in Oracle but doesn't work in PostgreSQL's JDBC, since we have
to use the same XAResource instance to prepare the xid.

I know why we have to 'prepare transaction xxx' in the same connection for
PostgreSQL kernel. For now my question is:  can we do the 'prepare
transaction 'xxx'' during XAResource.end(xid, TMSUCCESS); and later in
XAResource2.prepare(xid), we can double check if it is prepared already,
if so we can just return XA_OK. the benefit of this is that the user doesn't
have to prepare in the same connection.

Asking customers not to do this is not an option in my case, 
and I'm not asking our community to do so, I'm just asking what
would be wrong if we do so.

Any feedback is welcome,  Thanks!


--
Best Regards
Andy Fan

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

Предыдущее
От: Dave Cramer
Дата:
Сообщение: [pgjdbc/pgjdbc] c779e9: fix: Apply patch from Issue #2683 to fix hanging s...
Следующее
От: Rob Bygrave
Дата:
Сообщение: [pgjdbc/pgjdbc] 3b66f2: style: Style only change to use diamond operator i...