db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sabari S Kumar (JIRA)" <j...@apache.org>
Subject [jira] Commented: (DERBY-2532) Client does not return SQLException on XAConnection.getXAResource() on a closed connection, Embedded does
Date Wed, 26 Nov 2008 10:50:44 GMT

    [ https://issues.apache.org/jira/browse/DERBY-2532?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12650948#action_12650948
] 

Sabari S Kumar commented on DERBY-2532:
---------------------------------------

Exactly..i just wanted to confirm that this connection closing is not an issue..i was confused
with that comment in the problem statement ( // allow close on already closed XAConnection)...

And now about the "XAConnection.getXAResource() doesn't thrown an exception if the XAConnection
is closed" issue:

        ClientXADataSource dsx = new ClientXADataSource();
        XAConnection xac = dsx.getXAConnection();

Here getXAConnection returns a ClientXAConnection.The getXAResource() method is implemented
as:

public XAResource JavaDoc getXAResource() throws SQLException JavaDoc {
90         if (logWriter_ != null) {
91             logWriter_.traceExit(this, "getXAResource", xares_);
92         }
93
94         return xares_;
95     }

So will it be fine if we check whether the logical connection is still alive(can be done the
very same way as we did in the previous case,ie the repeated connection closing issue),and
if not alive we can force an SQLE .



> Client does not return SQLException on XAConnection.getXAResource() on a closed connection,
Embedded does
> ---------------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-2532
>                 URL: https://issues.apache.org/jira/browse/DERBY-2532
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>    Affects Versions: 10.3.1.4
>            Reporter: Myrna van Lunteren
>            Assignee: Sabari S Kumar
>
> In the following scenario from converted test DataSourceTest:
> (non-tested code based on the test code)
> ----------------
>         ClientXADataSource dsx = new ClientXADataSource();
>         dsx.setDatabaseName("tstdb");
>         XAConnection xac = dsx.getXAConnection();
>         XAConnection xac2 = dsx.getXAConnection();
>         XAResource xar2 = xac2.getXAResource();
>         xac2.close();
>         // allow close on already closed XAConnection
>         xac2.close();
>         try {
>             xac2.getXAResource();
>             // Network Server does not think this is worth an exception.
>         } catch (SQLException sqle) {
>             System.out.println("expect a 08003 as with Embedded");
>         }
> ------------------
> With DerbyNetClient, the xac2.getXAResource() does not return an SQLException.
> This ought to be documented if expected, or fixed.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message