From: Oliver Jowett <oliver@opencloud.com>
To: Michael Allman <msa@allman.ms>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc xa support
Date: Fri, 22 Jul 2005 17:02:18 +1200
Message-ID: <42E07DDA.7080103@opencloud.com> (raw)
In-Reply-To: <20050722003221.X7757@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>
Michael Allman wrote:
> The C version takes an argument specifying the maximum number of xids to
> recover. The Java version does not.
That's at least partly because the C version makes the caller allocate
the array.
> Without this information, the Java
> version not only looks silly but doesn't make a lot of sense either.
It seems ok to me -- it puts the burden for selecting a suitable batch
size on the resource rather than the TM, but that's six of one, half a
dozen of the other. That also means the RM can generate the array at
whatever size is convenient, rather than having to internally buffer if
it retrieves xids in some large block size than the TM selects.
It certainly doesn't make it more or less stateful, so I still don't
understand your original objection.
> For example, how many recovered xids should we return on the first call
> to recover()?
For our JDBC implementation? Set a fetchsize on your query to something
reasonable -- perhaps 500? -- and return up to that many Xids per call
until you hit the end of the resultset, then return empty arrays
thereafter until a new scan starts.
> Anyway, do you think my implementation of the recover() method violates
> the JTA spec?
The code in pgjdbcxa-20050721.jar appears to violate the spec, as you
completely ignore the flags argument. You need to track the recovery
scan state even if you decide to return all Xids in one array, because
subsequent calls shouldn't return those Xids again until a new scan is
started, per the API docs.
-O
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: oliver@opencloud.com, msa@allman.ms
Subject: Re: jdbc xa support
In-Reply-To: <42E07DDA.7080103@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>
* 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