From: Michael Allman <msa@allman.ms>
To: Oliver Jowett <oliver@opencloud.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc xa support
Date: Fri, 22 Jul 2005 02:25:47 -0400 (EDT)
Message-ID: <20050722020721.W29135@yvyyl> (raw)
In-Reply-To: <42E08A8E.5020807@opencloud.com>
References: <20050719193245.D20902@yvyyl>
<E3F1D1B7-B41C-40C4-9621-60F96363A032@fastcrypt.com>
<Pine.OSF.4.61.0507201916300.205200@kosh.hut.fi>
<20050720211921.V54984@yvyyl>
<Pine.OSF.4.61.0507212140250.34894@kosh.hut.fi>
<20050721203342.W75792@yvyyl>
<42E053B0.8080807@opencloud.com>
<20050721220519.U75792@yvyyl>
<42E05E6E.4070001@opencloud.com>
<20050722003221.X7757@yvyyl>
<42E07DDA.7080103@opencloud.com>
<20050722010716.D7757@yvyyl>
<42E08A8E.5020807@opencloud.com>
On Fri, 22 Jul 2005, Oliver Jowett wrote:
>> I do track the recovery scan state. Each call puts the scan cursor at the
>> end of the list.
>
> Uh, are we looking at the same code here? I don't see anything in the code
> from pgjdbcxa-20050721.jar that records whether we are at the end of the list
> or not between calls to recover(), and I don't see anything that looks for
> TMSTARTRSCAN to reset that state. If I've missed it, can you point it out to
> me?
You're right. But so am I. Since the code returns the complete list, the
"cursor" is always at the "end" of the "list" of prepared xids. The code
simply starts at the beginning for each call to recover().
>> I still don't see a violation of the API.
>
> The API says that if a TM does this:
>
> Xid[] xids_1 = resource.recover(TMSTARTRSCAN);
> Xid[] xids_2 = resource.recover(TMNOFLAGS);
> Xid[] xids_3 = resource.recover(TMNOFLAGS);
>
> then xids_1, xids_2, and xids_3 reflect consecutive (and possibly empty if
> you hit the end) parts of the recovery list. It seems your code does not
> respect this -- it will return the full list of Xids repeatedly in each of
> xids_1, xids_2 and xids_3.
I don't see anything in the JTA spec that says the TMNOFLAGS int means
anything other than that no other flag was passed to recover(). In the
DTP spec it says something about returning xids starting at the current
cursor position.
>> It looks like the JTA API is wrong or there's a typo. If we follow the
>> spirit of the DTP spec it seems that the TMNOFLAGS flag means "return some
>> xids starting from where we last left off". I'm still not sure what
>> TMENDRSCAN means.
>
> The JTA specification is fairly clear about their meanings. TMNOFLAGS does
> indeed mean "continue the current scan". TMENDRSCAN means "I'm done with this
> scan", and allows RMs to free resources they have allocated for the scan.
I added the lines
if (flag != TMSTARTRSCAN) {
return new Xid[0];
}
to the top of the recover() method and posted a new version at
http://www.allman.ms/pgjdbcxa/pgjdbcxa-20050722.jar
How does that look?
Michael
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: msa@allman.ms, oliver@opencloud.com
Subject: Re: jdbc xa support
In-Reply-To: <20050722020721.W29135@yvyyl>
References: <20050719193245.D20902@yvyyl> <E3F1D1B7-B41C-40C4-9621-60F96363A032@fastcrypt.com> <Pine.OSF.4.61.0507201916300.205200@kosh.hut.fi> <20050720211921.V54984@yvyyl> <Pine.OSF.4.61.0507212140250.34894@kosh.hut.fi> <20050721203342.W75792@yvyyl> <42E053B0.8080807@opencloud.com> <20050721220519.U75792@yvyyl> <42E05E6E.4070001@opencloud.com> <20050722003221.X7757@yvyyl> <42E07DDA.7080103@opencloud.com> <20050722010716.D7757@yvyyl> <42E08A8E.5020807@opencloud.com> <20050722020721.W29135@yvyyl>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox