Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WzBhz-0006Ks-7Z for pgsql-odbc@arkaria.postgresql.org; Mon, 23 Jun 2014 21:23:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WzBhy-0005IY-J0 for pgsql-odbc@arkaria.postgresql.org; Mon, 23 Jun 2014 21:23:22 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1WzBhy-0005IS-0b for pgsql-odbc@postgresql.org; Mon, 23 Jun 2014 21:23:22 +0000 Received: from sd.tpf.co.jp ([210.161.239.34]) by magus.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WzBht-0004Wn-2s for pgsql-odbc@postgresql.org; Mon, 23 Jun 2014 21:23:21 +0000 Received: (qmail 26825 invoked by uid 512); 23 Jun 2014 21:23:12 -0000 X-Authentication: inoue was authenticated by sd.tpf.co.jp at 23 Jun 2014 21:23:12 -0000 Received: from unknown (HELO ?192.168.1.8?) (183.76.63.174) by sd.tpf.co.jp with SMTP; 23 Jun 2014 21:23:12 -0000 Message-ID: <53A89AC5.4010004@tpf.co.jp> Date: Tue, 24 Jun 2014 06:23:17 +0900 From: "Inoue, Hiroshi" User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Craig Ringer CC: "pgsql-odbc@postgresql.org" Subject: Re: msdtc with 32-bit app fails to resolve in-doubt or not-notifed transactions References: <53A45B59.70303@2ndquadrant.com> <53A4A8FE.6010901@tpf.co.jp> <53A50F8E.3090109@2ndquadrant.com> <53A53BF9.1020603@2ndquadrant.com> <53A7762E.10705@tpf.co.jp> <53A781AE.6020009@2ndquadrant.com> In-Reply-To: <53A781AE.6020009@2ndquadrant.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-odbc Precedence: bulk Sender: pgsql-odbc-owner@postgresql.org (2014/06/23 10:23), Craig Ringer wrote: > On 06/23/2014 08:34 AM, Inoue, Hiroshi wrote: >> (2014/06/21 17:02), Craig Ringer wrote: >>> On 06/21/2014 12:52 PM, Craig Ringer wrote: >>>> >>>>> Oops, it's my mistake. It may be better to rewrite the code completely >>>>> using libpq APIs instead of ODBC APIs. >>>> >>>> I don't know if that'll work. >> >> The driver doesn't pass original connection strings to XARMCreate(). >> It seems possible to pass LIBPQ connection strings. > > Ah, I misunderstood that then. > > Great, that makes life easier. > >>> If the DSN is using SSPI, MSDTC.exe probably won't be able to >>> authenticate to the DB as them. Same with any other kind of connection >>> that depends on the properties of the current user account. >> >> Yes it's a severe problem. >> I'll try to check the good way to do it. > > Thanks for thinking about it. > >>> Where possible I'd like to find ways to produce useful errors though, >>> preferably at transaction enlistment time rather than commit phase II. >>> Suggestions would be valued. >> >> It's possible to reject transaction enlistments at XARMCreate() though >> I'm not sure if it's possible to tell the cause clearly to users. > > That'll be handy. As for telling users, we can always emit a message to > the Windows Event Log. Competent admins should be looking there anyway. > > However, AFAIK we have no way to find out in advance if a connstring or > DSN passed by the driver to msdtc for use in pgxalib will actually be > usable XARMCreate() triggers xa_open() ( and xa_close()) probably so as to check that the XADLL works. Currently xa_open() doesn't connect to the database and simply saves the connection information for subsequent xa_commit(), xa_rollback() or xa_recover() call. When original process finished COMMIT/ROLLBACK PREPARED properly, No database access occurs in msdtc process. We can change xa_open() so that it connects to the database immediately and causes an error to XARMCreate() when the connection fails. regards, Hiroshi Inoue > - in particular we have no way to query `pg_hba.conf` to see (a) > how our current connection was authenticated and (b) whether the same > connection settings would apply for the pgxalib connection. For example, > I don't think there's any way to tell if our current user/host/db combo > has a special cased 'trust' entry in pg_hba.conf that means other combos > will require a password. -- Sent via pgsql-odbc mailing list (pgsql-odbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-odbc