Well I see these as constants being defined as part of some interface(s) (space), hence they should be de-referenced through the interface as it is done within:

org.apache.derby.jdbc.EmbedXAConnection

[...]
                if (ret == XATransactionController.XA_OK) {
                    tranState.isPrepared = true;

                    return XAResource.XA_OK;
                } else {

                    returnConnectionToResource(tranState, xid_im);
                    return XAResource.XA_RDONLY;
                }
[...]

Note the 2 returns which will get you what is defined in the specs. hence no problem. It would be wrong to return XATransactionController.XA_OK directly to the external caller above as this last one depends on what's defined in XAResource as the public API. If it is not done like above in other areas of the code, then we would have a problem ;)

--francois

On 12/21/05, Bernt M. Johnsen <[EMAIL PROTECTED]> wrote:
>>>>>>>>>>>> Bernt M. Johnsen wrote (2005-12-21 12:53:49):
> I find it strange (and poteontially dangerous) that
>
> org.apache.derby.iapi.store.access.XATransactionController
> defines (public) that XA_OK = 2 and XA_RDONLY = 1

The same does org.apache.derby.iapi.store.raw.Transaction

> while the XA spec, the JTA spec and javax.transaction.xa.XAException
> defines XA_OK = 0 and XA_RDONLY = 3
>
> does anyone have a reasonable explanation?
> --
> Bernt Marius Johnsen, Database Technology Group,
> Sun Microsystems, Trondheim, Norway



--
Bernt Marius Johnsen, Database Technology Group,
Sun Microsystems, Trondheim, Norway



Reply via email to