Thread: XA registry entries are missing from 64-bit install

XA registry entries are missing from 64-bit install

From
Craig Ringer
Date:
Hi folks

A customer has pointed out as part of debugging an ODBC and MSDTC
related test case that the registry entries registering pgxalib.dll as a
valid XA transaction provider are not installed by the 64-bit MSI.

They're correctly created by the 32-bit installer MSI, at least on
64-bit Windows, where they appear in syswow64.

The missing entry is:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL]
"pgxalib.dll"="C:\Program Files\psqlODBC\0901\bin\pgxalib.dll"

but

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSDTC\XADLL]
"pgxalib.dll"="C:\Program Files (x86)\psqlODBC\0901\bin\pgxalib.dll"

is correctly created.

When I uninstalled 901 and reinstalled 903-300, neither entry was
removed or updated, so XA configuration was broken on both 32- and 64-bit.

This results in errors like:

    MSDTC XARMCreate Error

when using MSDTC apps.

I'm working on rebuilding the driver in its debug configuration to chase
some XA issues at the moment. When I've got that sorted out I'll see if
I can build an installer patch.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: XA registry entries are missing from 64-bit install

From
Craig Ringer
Date:
On 06/12/2014 11:52 AM, Craig Ringer wrote:
> Hi folks
>
> A customer has pointed out as part of debugging an ODBC and MSDTC
> related test case that the registry entries registering pgxalib.dll as a
> valid XA transaction provider are not installed by the 64-bit MSI.
>
> They're correctly created by the 32-bit installer MSI, at least on
> 64-bit Windows, where they appear in syswow64.
>
> The missing entry is:
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\XADLL]
> "pgxalib.dll"="C:\Program Files\psqlODBC\0901\bin\pgxalib.dll"
>
> but
>
> [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSDTC\XADLL]
> "pgxalib.dll"="C:\Program Files (x86)\psqlODBC\0901\bin\pgxalib.dll"

Oh, I forgot to mention the relevant MSDN article:

http://support.microsoft.com/kb/817066

which documents these entries and when they're required.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: XA registry entries are missing from 64-bit install

From
"Inoue, Hiroshi"
Date:
(2014/06/12 12:52), Craig Ringer wrote:
> Hi folks
>
> A customer has pointed out as part of debugging an ODBC and MSDTC
> related test case that the registry entries registering pgxalib.dll as a
> valid XA transaction provider are not installed by the 64-bit MSI.
>
> They're correctly created by the 32-bit installer MSI, at least on
> 64-bit Windows, where they appear in syswow64.

The installer MSIs don't create the registry entries currently.
pgenlist(a).dll associated with the drivers try to create the
entries when (maybe first) IDtcToXaHelperSinglePipe::XARMCreate()
call fails. Invoking 64bit MSDTC related applications would resolve
the problem if possible.

Because msdtc process seems a 64bit application, 64bit pgxalib.dll
should be registered even when 32bit applications use MSDTC support.
The current way of registration isn't appropriate and 64bit installer
would have to register the entry beforehand.

regards,
Hiroshi Inoue


--
I am using the free version of SPAMfighter.
SPAMfighter has removed 10777 of my spam emails to date.
Get the free SPAMfighter here: http://www.spamfighter.com/len

Do you have a slow PC? Try a Free scan
http://www.spamfighter.com/SLOW-PCfighter?cid=sigen



Re: XA registry entries are missing from 64-bit install

From
Craig Ringer
Date:
On 06/12/2014 02:02 PM, Inoue, Hiroshi wrote:
>
>
> Because msdtc process seems a 64bit application, 64bit pgxalib.dll
> should be registered even when 32bit applications use MSDTC support.
> The current way of registration isn't appropriate and 64bit installer
> would have to register the entry beforehand.

OK, so if I understand this right, it might be helpful to have
pgenlist.dll expose a function that's callable with rundll32 to create
the registry entries. Call it, say, registerxa().

Then the registry entry creation code currently in
EnlistInDtc_1pipe(...) could be factored out so it's callable as part of
EnlistInDtc_1pipe(...) or via the new entry point.

The installer can then invoke

    rundll32 pgenlist.dll,registerxa

to create the appropriate entries.

Reasonable?

Or is it better to just create/update the registry entries directly
using the MSI?

Looking at the current code, it appears that it tries to overwrite any
existing value in that subkey if XA enlistment fails. So it should also
"upgrade" existing entries. Right?

--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: XA registry entries are missing from 64-bit install

From
Craig Ringer
Date:
On 06/12/2014 04:28 PM, Craig Ringer wrote:
> On 06/12/2014 02:02 PM, Inoue, Hiroshi wrote:
>>
>>
>> Because msdtc process seems a 64bit application, 64bit pgxalib.dll
>> should be registered even when 32bit applications use MSDTC support.
>> The current way of registration isn't appropriate and 64bit installer
>> would have to register the entry beforehand.
>
> OK, so if I understand this right, it might be helpful to have
> pgenlist.dll expose a function that's callable with rundll32 to create
> the registry entries. Call it, say, registerxa().
>
> Then the registry entry creation code currently in
> EnlistInDtc_1pipe(...) could be factored out so it's callable as part of
> EnlistInDtc_1pipe(...) or via the new entry point.
>
> The installer can then invoke
>
>     rundll32 pgenlist.dll,registerxa
>
> to create the appropriate entries.
>
> Reasonable?
>
> Or is it better to just create/update the registry entries directly
> using the MSI?

Looks like it might be.

http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/write_a_registry_entry.html

and the entry should be able to be generated within the WiX file using
the properties like the version and install path.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


Re: XA registry entries are missing from 64-bit install

From
"Inoue, Hiroshi"
Date:

(2014/06/12 17:28), Craig Ringer wrote:
> On 06/12/2014 02:02 PM, Inoue, Hiroshi wrote:
>>
>>
>> Because msdtc process seems a 64bit application, 64bit pgxalib.dll
>> should be registered even when 32bit applications use MSDTC support.
>> The current way of registration isn't appropriate and 64bit installer
>> would have to register the entry beforehand.
>
> OK, so if I understand this right, it might be helpful to have
> pgenlist.dll expose a function that's callable with rundll32 to create
> the registry entries. Call it, say, registerxa().

It should be done for pgxalib.dll not pgenlist(a).dll if we do
such kind of registration.

> Then the registry entry creation code currently in
> EnlistInDtc_1pipe(...) could be factored out so it's callable as part of
> EnlistInDtc_1pipe(...) or via the new entry point.
>
> The installer can then invoke
>
>      rundll32 pgenlist.dll,registerxa
>
> to create the appropriate entries.
>
> Reasonable?
>
> Or is it better to just create/update the registry entries directly
> using the MSI?

Yes it seems better.

> Looking at the current code, it appears that it tries to overwrite any
> existing value in that subkey if XA enlistment fails. So it should also
> "upgrade" existing entries. Right?

Yes but the implementation of pgxalib.dll has not been changed
for a long time. There's little dependency between pgxalib.dll
and drivers

regards,
Hiroshi INoue


Re: XA registry entries are missing from 64-bit install

From
Hiroshi Inoue
Date:
(2014/06/13 2:57), Inoue, Hiroshi wrote:
>
> (2014/06/12 17:28), Craig Ringer wrote:
>> On 06/12/2014 02:02 PM, Inoue, Hiroshi wrote:
>>>
>>>
>>> Because msdtc process seems a 64bit application, 64bit pgxalib.dll
>>> should be registered even when 32bit applications use MSDTC support.
>>> The current way of registration isn't appropriate and 64bit installer
>>> would have to register the entry beforehand.
>>
>> OK, so if I understand this right, it might be helpful to have
>> pgenlist.dll expose a function that's callable with rundll32 to create
>> the registry entries. Call it, say, registerxa().
>
> It should be done for pgxalib.dll not pgenlist(a).dll if we do
> such kind of registration.
>
>> Then the registry entry creation code currently in
>> EnlistInDtc_1pipe(...) could be factored out so it's callable as part of
>> EnlistInDtc_1pipe(...) or via the new entry point.
>>
>> The installer can then invoke
>>
>>      rundll32 pgenlist.dll,registerxa
>>
>> to create the appropriate entries.
>>
>> Reasonable?
>>
>> Or is it better to just create/update the registry entries directly
>> using the MSI?
>
> Yes it seems better.

OK I pushd the change together with your patch [ODBC] PATCH: WiX
has moved.

regards,
Hiroshi Inoue