X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 02584528CF for ; Fri, 22 Jul 2005 02:02:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 67714-08 for ; Fri, 22 Jul 2005 05:02:23 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 6BE9A52892 for ; Fri, 22 Jul 2005 02:02:18 -0300 (ADT) Received: from flood.opencloud.co.nz ([192.168.0.31]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1Dvpfu-0006gi-QO; Fri, 22 Jul 2005 17:02:18 +1200 Message-ID: <42E07DDA.7080103@opencloud.com> Date: Fri, 22 Jul 2005 17:02:18 +1200 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.7.3 (X11/20040803) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Michael Allman Cc: pgsql-jdbc@postgresql.org Subject: Re: jdbc xa support References: <20050719193245.D20902@yvyyl> <20050720211921.V54984@yvyyl> <20050721203342.W75792@yvyyl> <42E053B0.8080807@opencloud.com> <20050721220519.U75792@yvyyl> <42E05E6E.4070001@opencloud.com> <20050722003221.X7757@yvyyl> In-Reply-To: <20050722003221.X7757@yvyyl> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.007 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200507/239 X-Sequence-Number: 13387 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