[
https://issues.apache.org/jira/browse/DERBY-1016?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12741104#action_12741104
]
Myrna van Lunteren commented on DERBY-1016:
-------------------------------------------
Thanks Tiago for your email to the list indicating you ran suites.All
successfully.
However, I thought it prudent to run derbyall (with ibm16 and sane classes),
and it popped one new test failure (apart from a failure in
unit/T_RawStoreFactory.unit, similar to the closed DERBY-654, which we can
ignore here because I often get it on my machine with this configuration):
jdbcapi/xaSimpleNegative.sql. This test apparently already had a test for the
XaResource.forget...
And as expected, it now shows XAER_PROTO instead of XAER_NOTA.
However, it has another test case of XAResource.forget, and that now returns
XAER_NOTA instead of XAER_PROTO
Looking at the code change, this is logical, but I'm just not sure that we're
doing the right thing.
Should both cases return XAER_PROTO?
I looked at the diff for a while, but would like to get the opinion of someone
who understands/knows the XA specs better....
This is the flip/flop section:
-------------------------------------------------
ij(XA)> -- start one
xa_start xa_noflags 1;
ij(XA)> -- ERROR: can only forget heuristically completed transaction
xa_forget 1;
IJ ERROR: XAER_NOTA
<---returns XAER_PROTO after patch
ij(XA)> delete from APP.negative;
1 row inserted/updated/deleted
ij(XA)> xa_end xa_success 1;
ij(XA)> -- ERROR: now try some bad flag
xa_start xa_suspend 1;
IJ ERROR: XAER_INVAL
ij(XA)> -- ERROR: now try some bad flag
xa_start xa_fail 1;
IJ ERROR: XAER_INVAL
ij(XA)> xa_prepare 1;
ij(XA)> -- can only forget heuristically completed transaction
xa_forget 1;
IJ ERROR: XAER_PROTO
<--returns XAER_NOTA after patch
--------------------------------------------------------------
> javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of
> XA_PROTO on a prepared transaction
> ----------------------------------------------------------------------------------------------------------
>
> Key: DERBY-1016
> URL: https://issues.apache.org/jira/browse/DERBY-1016
> Project: Derby
> Issue Type: Bug
> Components: JDBC
> Affects Versions: 10.1.3.1, 10.2.1.6
> Reporter: Kathey Marsden
> Assignee: Tiago R. Espinha
> Attachments: DERBY-1016.patch, DERBY-1016.patch,
> DERBY-1016_Patch_1.diff, ReproDerby1016.java, utilXid.java
>
>
> javax.transaction.xa.forget (Xid) raises XAER_NOTA exception instead of
> XA_PROTO on a prepared transaction
> I posted a question to derby-dev about this and heard no response so am
> assuming it is indeed a bug.
> in the XA+
> specification, it seems like xa_forget should only be valid for a
> heuristically completed transaction, so should be XAER_PROTO
> and not XAER_NOTA.
> In xaStateTran.sql we have this case:
> -- get back into prepared state
> xa_start xa_noflags 50;
> insert into xastate values(2);
> xa_end xa_success 50;
> xa_prepare 50;
> select * from global_xactTable where gxid is not null order by gxid;
> -- the following should error XAER_NOTA
> xa_forget 50;
> The user code I am looking at handles forget like this. They expect
> XAER_PROTO in this case.
>
> try {
> xaRes.forget(xidList[i]);
> System.out.print("XA-Transaction [" + (i+1) + "]
> Forgotten. \n" );
> } catch (XAException XAeForget) {
> if ( XAeForget.errorCode ==
> XAException.XAER_PROTO ) {
> System.out.print("XA-Transaction [" + (i+1)
> + "] not heuristically completed yet - Rolling Back instead. \n" );
> xaRes.rollback(xidList[i]);
> System.out.print("XA-Transaction [" + (i+1)
> + "] Rolled Back. \n" );
> }
> if ( XAeForget.getMessage() != null ) {
> System.out.println("XAException " +
> XAeForget.getMessage() );
>
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.