Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 58C519FA5B5 for ; Tue, 31 Oct 2006 09:22:51 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 13878-06 for ; Tue, 31 Oct 2006 13:22:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from ug-out-1314.google.com (ug-out-1314.google.com [66.249.92.173]) by postgresql.org (Postfix) with ESMTP id 7FE429FA4A3 for ; Tue, 31 Oct 2006 09:22:46 -0400 (AST) Received: by ug-out-1314.google.com with SMTP id 30so1254495ugc for ; Tue, 31 Oct 2006 05:22:44 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:mime-version:to:cc:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=lsgkv+zPyn7BAJlhOX55ueLMlgESAEmu/hC5Dh2Q5Fu6oLxpEQmEI8UPyuX5p3LFx9x+uC+MLwM0ztDSO0KNihoDD8fFFZUi98JFsGqin+u3vXb+WZg6fRA9fMTvqdM6E1ePZze1vmPdwyMM3cv6Kz7XmQdIhLBNc4dgmo5NC40= Received: by 10.67.97.18 with SMTP id z18mr6039272ugl; Tue, 31 Oct 2006 05:22:44 -0800 (PST) Received: from ?192.168.0.22? ( [62.232.55.118]) by mx.google.com with ESMTP id e34sm4967229ugd.2006.10.31.05.22.43; Tue, 31 Oct 2006 05:22:44 -0800 (PST) Message-ID: <45474E22.50902@enterprisedb.com> Date: Tue, 31 Oct 2006 13:22:42 +0000 From: Heikki Linnakangas User-Agent: Thunderbird 1.5.0.7 (X11/20060927) MIME-Version: 1.0 To: Ludovic Orban CC: Kris Jurka , pgsql-jdbc@postgresql.org Subject: Re: Postgres XA support References: <45288F3C.1030906@ejurka.com> <45297847.7060304@ejurka.com> <452A2CA0.2080900@enterprisedb.com> <452ABFFE.3000108@enterprisedb.com> <452BA80C.7060605@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200610/153 X-Sequence-Number: 16036 Ludovic Orban wrote: > Kris, > > 2006/10/30, Kris Jurka : >> >> I see how Allan's patch would get UPDATE 1 to commit, but UPDATE 2 and 3 >> are the equivalent of an interleaved transaction and I don't see how that >> could possibly work. I'm not sure what sort of protection we need to add >> to prevent people from doing this or other transaction handling >> actions on >> the connection. Right now the Connection object doesn't know if it is >> being used by a XADatasource. > > The problem is not if a connection was created by an XADatasource or > not but if it is being used in a global transaction context or not. Agreed. > Weblogic's connection pool has a parameter called > local-transaction-supported which when set to false will disallow > local transactions to be executed on connections taken from that pool. The WebLogic manual isn't very helpful, this is all I found regarding that parameter: "local-transaction-supported — Optional. Boolean. Set the local-transaction-supported to true if the XA driver supports SQL with no global transaction; otherwise, set it to false. The default value is false." It doesn't actually say what difference it makes or why you would want to set it to true. I don't see how a transaction manager could generally make use of the feature, because it doesn't know if a transaction is distributed or not until it's committed or the second resource is enlisted. > I guess you could enforce the same behavior in the driver by throwing > a SQLException when some query is executed and XAResource.start() has > not been called yet or XAResource.end() has already been called. That seems like the easiest solution. We'll have to wrap the Connection object returned by PGXAConnection.getConnection so we can intercept execute-calls, though. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com