You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Daniel John Debrunner (JIRA)" <de...@db.apache.org> on 2006/02/22 02:48:51 UTC

[jira] Created: (DERBY-1025) XAResource.start() does not commit an active local transaction when auto commit is true

XAResource.start() does not commit an active local transaction when auto commit is true
---------------------------------------------------------------------------------------

         Key: DERBY-1025
         URL: http://issues.apache.org/jira/browse/DERBY-1025
     Project: Derby
        Type: Bug
    Reporter: Daniel John Debrunner


Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.

Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)

XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]
     
Andrew McIntyre closed DERBY-1025:
----------------------------------

    Fix Version: 10.1.3.0
     Resolution: Fixed

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>      Fix For: 10.2.0.0, 10.1.3.0, 10.1.2.4
>  Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374444 ] 

Deepa Remesh commented on DERBY-1025:
-------------------------------------

I looked into this a bit more and found that embedded and client are actually returning the same XA error code (XAER_DUPID). I printed out the error code in the test to verify this. The test just calls getMessage() on the XAException and prints it out. In case of embedded, I think the message is null. Whereas, in case of client, I see that the method NetXAResource.xaRetValErrorAccumSQL creates a message as follows: 
---------------------------------------------------------------------------------------------------------------------------------------------------
if (rc != XAResource.XA_OK) { // error was detected
            // create an SqlException to report this error within
            String xaRetValStr = "Error executing a " +
                    getXAFuncStr(callInfo.xaFunction_) + ", " +
                    "Server returned " + getXAExceptionText(rc);

---------------------------------------------------------------------------------------------------------------------------------------------------

This accounts for the difference in embedded and client messages. 

However, it is not clear to me what the purpose of this test is. If it is meant to check for XAER_DUPID, it does not seem to fit into the remaining tests.  I need to look into this some more. 
---------------------------------------------------------------------------------------------------------------------------------------------------
               try {
			xac4.getXAResource().start(xid4a, XAResource.TMNOFLAGS);
		} catch (XAException xae) {
			showXAException("autocommitxastart expected ", xae);
		}

---------------------------------------------------------------------------------------------------------------------------------------------------

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Deepa Remesh updated DERBY-1025:
--------------------------------

    Attachment: derby-1025-draft1.diff
                derby-1025-draft1.status

Attaching a draft patch 'derby-1025-draft1.diff' which is only for review and not for commit. This fixes the repros in the tests XATest.java and checkDataSource.java.

I have a question about the expected exceptions in the test checkDataSource.java. The exceptions thrown by the client are different from what is thrown by the embedded driver. Specifically, I want to make sure this is the expected exception in the following case:

---------------------------------------------------------------------------------------------------------------------------------------------------
		conn4.setAutoCommit(false);

		rs4 = s4.executeQuery("select i from autocommitxastart");
		rs4.next(); System.out.println("acxs " + rs4.getInt(1));
		rs4.next(); System.out.println("acxs " + rs4.getInt(1));

		try {
			xac4.getXAResource().start(xid4a, XAResource.TMNOFLAGS);
		} catch (XAException xae) {
			showXAException("autocommitxastart expected ", xae);
		}
---------------------------------------------------------------------------------------------------------------------------------------------------
Exception:
autocommitxastart expected  : XAException - XAER_DUPID : Error executing a XAResource.start(), Server returned XAER_DUPID
---------------------------------------------------------------------------------------------------------------------------------------------------

With the draft patch, I have only run jdbcapi/checkDataSource.java and jdbcapi/XATest.java in client framework. I will be running derbynetclientmats shortly. Also, for testing purposes, I have removed the test jdbcapi/checkDataSource.java from DerbyNetClient.exclude.

I would appreciate if someone can go through this patch quickly and let me know if the changes are okay. 

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374403 ] 

Daniel John Debrunner commented on DERBY-1025:
----------------------------------------------

There's a chance that changes to the code preceeding that masked the issue, or maybe the pre-fetching changed behaviour by fetching
rows and causing a commit..

I added this code just before the code you commented out and saw the issue again:

            rs.close(); 
             // ensure a transaction is active to test DERBY-1025
            rs = sdh.executeQuery("SELECT * FROM APP.FOO");

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]
     
Deepa Remesh resolved DERBY-1025:
---------------------------------

    Fix Version: 10.2.0.0
                 10.1.2.4
     Resolution: Fixed

Patches committed as revision# 394134,394949 in trunk; revision# 394230 in 10.1 branch


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>      Fix For: 10.2.0.0, 10.1.2.4
>  Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Deepa Remesh updated DERBY-1025:
--------------------------------

    Attachment: derby-1025-patch2-v1.diff
                derby-1025-patch2-v1.status

Thanks Kathey for updating the master files. The diffs in the master file are expected. This is because the error messages were changed by commit for DERBY-842, svn revision# 393967. I had my workspace synched up to a older revision when I created the patch.

I am attaching 'derby-1025-patch2-v1.diff' which changes checkDataSource test to test that starting a global transcation when a local transaction is active will give an exception. The XA error code is also printed out to verify that we get the expected exception. This patch will resolve this issue fully.

With this patch, I have run checkDataSource checkDataSource30 tests with embedded and client frameworks. Please take a look at this patch.


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374404 ] 

Kathey Marsden commented on DERBY-1025:
---------------------------------------

There is a case disabled for DERBY-1025 in jdbcapi/checkDataSource.java  as well.  



> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Deepa Remesh reassigned DERBY-1025:
-----------------------------------

    Assign To: Deepa Remesh  (was: Kathey Marsden)

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Closed: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden closed DERBY-1025.
---------------------------------


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Deepa Remesh
>             Fix For: 10.1.3.1, 10.2.1.6
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Assigned: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Kathey Marsden reassigned DERBY-1025:
-------------------------------------

    Assign To: Kathey Marsden

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Kathey Marsden

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374540 ] 

Kathey Marsden commented on DERBY-1025:
---------------------------------------

I checked the patch into the trunk:
Date: Fri Apr 14 09:30:00 2006
New Revision: 394134

URL: http://svn.apache.org/viewcvs?rev=394134&view=rev

This change looks good to me but when I ran jdbcapi/checkDataSource.java  and jdbcapi/checkDataSource30.java and  with client I got these (expected I think) diffs.  I updated the masters and checked in.
Please check that the output difference is expected.

Attempt to shutdown framework: DerbyNetClient
58 del
< expected java.sql.SQLException: Invalid operation: result set closed
58a58
> expected java.sql.SQLException: 'ResultSet' already closed.
460 del
< autocommitxastart expected Invalid operation: result set closed
460a460
> autocommitxastart expected 'ResultSet' already closed.
Test Failed.
*** End:   checkDataSource jdk1.4.2_07 DerbyNetClient 2006-04-14 09:04:19 ***
*** Start: checkDataSource30 jdk1.4.2_07 DerbyNetClient 2006-04-14 09:17:14 ***
Initialize for framework: DerbyNetClient
java -Dderby.system.home=D:\testout\DerbyNetClient\checkDataSource30 -Djava.security.manager -Djava.security.policy=D:\testout\derby_tests.policy -DderbyTesting.codeclasses=file:/D:/p4/marsden_patch/c
lasses/ -DderbyTesting.codedir=D:\p4\marsden_patch\classes -DderbyTesting.serverhost=localhost -DderbyTesting.clienthost=localhost -DderbyTesting.codejar=file://unused/ org.apache.derby.drda.NetworkSe
rverControl start
Attempt to shutdown framework: DerbyNetClient
70 del
< expected java.sql.SQLException: Invalid operation: result set closed
70a70
> expected java.sql.SQLException: 'ResultSet' already closed.
551a552,559
> conn4 autcommit true
> acxs 1
> acxs 2
> autocommitxastart expected 'ResultSet' already closed.
> acxs 1
> acxs 2
> autocommitxastart expected  : XAException - XAER_DUPID : Error executing a XAResource.start(), Server returned XAER_DUPID
> acxs 3
578 del
< Expected SQLException Invalid operation: result set closed
578a586
> Expected SQLException 'ResultSet' already closed.
590 del
< Expected SQLException Invalid operation: result set closed
591 del
< Expected SQLException Invalid operation: result set closed
591a598,599
> Expected SQLException 'ResultSet' already closed.
> Expected SQLException 'ResultSet' already closed.
Test Failed.
*** End:   checkDataSource30 jdk1.4.2_07 DerbyNetClient 2006-04-14 09:18:29 ***


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden resolved DERBY-1025.
-----------------------------------

    Resolution: Fixed
      Assignee: Deepa Remesh  (was: Kathey Marsden)

Fixed the test case to create the statement CLOSE_CURSORS_AT_COMMIT.  Filed DERBY-2620 for an issue with embedded losing the connection in this case.

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Deepa Remesh
>             Fix For: 10.2.1.6, 10.1.3.1
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Assigned: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kathey Marsden reassigned DERBY-1025:
-------------------------------------

    Assignee: Kathey Marsden  (was: Deepa Remesh)

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Kathey Marsden
>             Fix For: 10.1.3.1, 10.2.1.6
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Reopened: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Myrna van Lunteren (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Myrna van Lunteren reopened DERBY-1025:
---------------------------------------


I believe this was incorrectly closed.
Although I don't see the XAID_DUP error, so there was improvement, it seems to me the transaction is still active.

checkDataSource has I think a mistake in it that gave the impression this was fixed:

    try {
         rs4.next(); System.out.println("acxs " + rs.getInt(1))
    } catch (SQLException sqle) {
         System.out.println("autocommitxastart expected " + sqle.getMessage());
    }

We're doing rs4.next(), but then attempt to get a value out of rs, rather than rs4. rs has been closed way before this point, so not surprisingly, this gives an sqlexception.

When I change rs.getInt(1) to rs4.getInt(1), things work unchanged for embedded. However, with DerbyNetClient, we get different behavior; we happily get a value returned (3). 


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Deepa Remesh
>             Fix For: 10.1.3.1, 10.2.1.6
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12372170 ] 

Daniel John Debrunner commented on DERBY-1025:
----------------------------------------------

I wonder if the problem you are seeing may be due to this code in DRDAStatement:

	/**
	 * Get prepared statement
	 *
	 * @return prepared statement
	 */
	protected PreparedStatement getPreparedStatement() throws SQLException
	{
		if (ps instanceof BrokeredPreparedStatement)
			return (PreparedStatement)(
						   ((BrokeredPreparedStatement) ps).getStatement());
		else
			return ps;
	}


This code, for some unknown reason due to lack of comments, is getting the underlying embedded statement
from a BrokeredPreparedStatement.  This should not be allowed, the BrokeredStatement wrappers are there to
hide the embedded statement object as it can change under the covers of the wrapper.

It could be that the network server is getting the prepared statement and then hanging on too long and performing
actions on the wrong object. Though it seems unlikely that auto-commit on a connection would go through the
prepared statement.

I wonder why this code needs the inner statement

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Kathey Marsden

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Daniel John Debrunner (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374440 ] 

Daniel John Debrunner commented on DERBY-1025:
----------------------------------------------

The change in NetXAResource looks ok. The XAER_DUPID (duplicate xid) exception looks wrong though. The error code should match embedded.
Make sure the rs4 result set has not closed and thus committed the transaction, maybe fetch less rows or no at all?

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Updated: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Deepa Remesh updated DERBY-1025:
--------------------------------

    Attachment: derby-1025-10.1.diff
                derby-1025-10.1.status

Attaching 'derby-1025-10.1.diff' for 10.1 branch. A direct merge does not work because the test checkDataSource is not enabled for client in 10.1. 

I ran derbynetclientmats using Sun JDK 1.4.2 on Windows XP. I also ran the test jdbcapi/XATest on client and embedded frameworks. Please look at this patch.

NOTE: 
There are two pending patches attached to this issue:
* derby-1025-10.1.diff for 10.1 branch
* derby-1025-patch2-v1.diff for trunk (changes to the test checkDataSource.java)


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Reopened: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Andrew McIntyre (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]
     
Andrew McIntyre reopened DERBY-1025:
------------------------------------


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>      Fix For: 10.2.0.0, 10.1.3.0, 10.1.2.4
>  Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12369590 ] 

Kathey Marsden commented on DERBY-1025:
---------------------------------------


So on XAResource.start() we need to flowcommit if
1) We are in autocommit mode. 
        conn_.autocommit_ == true
2) We are in a an active local Transaction.
   conn_getXAState() == XA_T0_NOT_ASSOCIATED
   conn_.inUnitOfWork_ == true

For my first shot at fixing this bug I added the folling code to 
NetXAResource.start()
	// DERBY-1025 
        // autocommit the local transaction before starting the global transaction
        // if autocommit is set
        if (conn_.autoCommit_  && conn_.inActiveLocalTransaction())
        {
		conn_.flowAutoCommit();
        }
   	
   
Where in NetXAConnection we have
public boolean inActiveLocalTransaction() {
		return (isInUnitOfWork_() && 
    			(getXAState() == XA_T0_NOT_ASSOCIATED));   
		
	}

And in Connection.java
	/**
	 * @return Returns the inUnitOfWork_.
	 */
	public boolean isInUnitOfWork_() {
		return inUnitOfWork_;
	}


With my change, putting this code in I found some very strange behaviour in this case in XATest
1)  I got a commit on start when no local transaction was active after  a suspend
2)  I seemed to lose a totally different suspended transaction in the process.

See comments for behaviour:
    private static void interleavingTransactions(XADataSource xads) {
        System.out.println("interleavingTransactions");
        try {
            XAConnection xac = xads.getXAConnection("sku", "testxa");
            XAResource xar = xac.getXAResource();

            Xid xid1 = XATestUtil.getXid(1, 93, 18);
            Xid xid2 = XATestUtil.getXid(2, 45, 77);

            xar.start(xid1, XAResource.TMNOFLAGS);

            Connection conn = xac.getConnection();

            Statement s = conn.createStatement();
            s.executeUpdate("insert into APP.foo values (1)");
            xar.end(xid1, XAResource.TMSUSPEND);
            // commit occurred here because inUnitOfWork_ was true
            // when it should be false.
            xar.start(xid2, XAResource.TMNOFLAGS);
            s.executeUpdate("insert into APP.foo values (2)");
            xar.end(xid2, XAResource.TMSUSPEND);
            
            xar.start(xid1, XAResource.TMRESUME);
            s.executeUpdate("insert into APP.foo values (3)");
            // XAER_NOTA on suspend  of xid1.
            // very strange because the resume worked ok.
            // where did it go?
            xar.end(xid1, XAResource.TMSUSPEND);


I am trying to understand:

1)  When and how inUnitOfWork_ is set and its relation to XA
2)  Why the autocommit after the suspension of xid2 caused xid1 to go away after it resumed just fine.

All very strange.


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Kathey Marsden

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494167 ] 

Daniel John Debrunner commented on DERBY-1025:
----------------------------------------------

In jdbcapi.DataSourceTest there is a piece of code with this comment related to this bug:

        // DERBY-1025.
        // With Embedded, this will give error: 08003 - No current connection
        // But with NetworkServer / DerbyNetClient, the transaction does not
        // appear to be closed, and we actually get a value.


The comment related to the network server does not seem valid any more.
Assuming the test passes since the path through the code that would result in getting a value back would result in fail() being called.
Should the comment be cleaned up to reflect reality or am I missing something?

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Deepa Remesh
>             Fix For: 10.1.3.1, 10.2.1.6
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Updated: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Kathey Marsden updated DERBY-1025:
----------------------------------

    Component: Network Client
      Summary: [xa] client XAResource.start() does not commit an active local transaction when auto commit is true  (was: XAResource.start() does not commit an active local transaction when auto commit is true)

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Reporter: Daniel John Debrunner

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Kathey Marsden (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-1025?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12494117 ] 

Kathey Marsden commented on DERBY-1025:
---------------------------------------

Looking at the test, I think to test whether the cursor is closed we needed to create the statement with CLOSE_CURSRS_AT_COMMIT.  Making that change, client seems to work as expected.  We get SQLState XCL16, but embedded is getting 08003 - No current connection, which I think is wrong. The connection should still be valid. It is only the resultset that is closed. I will open another issue for that and submit the test change.


> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-1025
>                 URL: https://issues.apache.org/jira/browse/DERBY-1025
>             Project: Derby
>          Issue Type: Bug
>          Components: Network Client
>            Reporter: Daniel John Debrunner
>         Assigned To: Kathey Marsden
>             Fix For: 10.1.3.1, 10.2.1.6
>
>         Attachments: derby-1025-10.1.diff, derby-1025-10.1.status, derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status, derby-1025-patch2-v1.diff, derby-1025-patch2-v1.status
>
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

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


[jira] Updated: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
     [ http://issues.apache.org/jira/browse/DERBY-1025?page=all ]

Deepa Remesh updated DERBY-1025:
--------------------------------

    Attachment: derby-1025-patch1-v1.diff
                derby-1025-patch1-v1.status

Thanks Dan and Kathey for replying to my questions. I am attaching a patch 'derby-1025-patch1-v1.diff' which makes client's XAResource.start() to commit a local transaction when auto commit is true. 

------------------------------------------------
Summary:
------------------------------------------------
* Modifies NetXAResource.start to check if the connection is in autocommit mode and flow an auto commit.
* Uncomments the tests for this issue in jdbcapi/XATest.java and jdbcapi/checkDataSource.java

------------------------------------------------
Test:
------------------------------------------------
With this patch, I ran derbynetclientmats using Sun JDK1.4.2 on Windows XP. I also ran checkDataSource test in client framework by temporarily removing it from the exclude file. 

------------------------------------------------
Questions:
------------------------------------------------
* When working on this issue, I saw this piece of code in client's Connection.flowCommit method:
        // Per JDBC specification (see javadoc for Connection.commit()):
        //   "This method should be used only when auto-commit mode has been disabled."
        // However, some applications do this anyway, it is harmless, so
        // if they ask to commit, we could go ahead and flow a commit.
        // But note that rollback() is less harmless, rollback() shouldn't be used in auto-commit mode.
        // This behavior is subject to further review.

        //   if (!this.inUnitOfWork)
        //     return;
        // We won't try to be "too smart", if the user requests a commit, we'll flow a commit,
        // regardless of whether or not we're in a unit of work or in auto-commit mode.
        //

I saw that Kathey's trial patch was trying to check if we are in unit of work before calling flowAutoCommit. On looking at the flowAutoCommit method, I saw that this logic was planned to be in the commit method itself but currently it is commented out mentioning "further review". Should I open a JIRA issue for this so that we can pursue this later?

* I think the test for derby-1025 in checkDataSource.java is wrongly testing XAER_DUPID because the second transaction uses the same xid. I think we want to test that we cannot start a global transaction when the resource manager is doing some work outside. I have changed the test to use a different xid. And now the test gives me XAER_OUTSIDE,which I think is what we want to test. If I'm wrong here, please let me know. I'll submit a separate patch for this.

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh
>  Attachments: derby-1025-draft1.diff, derby-1025-draft1.status, derby-1025-patch1-v1.diff, derby-1025-patch1-v1.status
>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Commented: (DERBY-1025) [xa] client XAResource.start() does not commit an active local transaction when auto commit is true

Posted by "Deepa Remesh (JIRA)" <de...@db.apache.org>.
    [ http://issues.apache.org/jira/browse/DERBY-1025?page=comments#action_12374400 ] 

Deepa Remesh commented on DERBY-1025:
-------------------------------------

I was looking at this and understanding the differences between embedded and client code. I see the client does not have code to commit in auto-commit mode. I was trying to test my changes when I found that this problem no longer reproduces with the latest trunk. 

What I tried was - run jdbcapi/XATest.java in client framewrok by commenting out the following workaround in the test:
            // DERBY-1025 Client only bug
            /*if (TestUtil.isDerbyNetClientFramework()) {
                System.out.println("DERBY-1025 Call conn.commit to avoid exception with client");
                conn.commit();
            }
            */

I do not get any exceptions. I ran this about 10 times and the test passes without the explicit "commit" workaround. Can someone please confirm this is right way to repro this issue? If anyone knows any other repros, please let me know.

> [xa] client XAResource.start() does not commit an active local transaction when auto commit is true
> ---------------------------------------------------------------------------------------------------
>
>          Key: DERBY-1025
>          URL: http://issues.apache.org/jira/browse/DERBY-1025
>      Project: Derby
>         Type: Bug

>   Components: Network Client
>     Reporter: Daniel John Debrunner
>     Assignee: Deepa Remesh

>
> Embedded XAResource.start() implementation commits the active local transaction on the Connection associated with the XAResource if the connection is auto-commit mode.
> Client incorrectly throws an XAException with the XAER_RMFAIL error code (see DERBY-1024)
> XATest contains a work-around for client (calling commit) with a comment with this bug number.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira