prepared rollback error

108 views
Skip to first unread message

Stéphane Lacoin

unread,
Apr 30, 2014, 12:32:46 PM4/30/14
to h2-da...@googlegroups.com
Hi,

We're in the process of upgrading h2 in Nuxeo. We've got an issue in our test cases about XA management. Here is the part of the test case that's in trouble

 xaresource.start(xid, XAResource.TMNOFLAGS);
        // ... write data ...
        xaresource.end(xid, XAResource.TMSUCCESS);
        xaresource.prepare(xid);
        xaresource.rollback(xid);

The error is raised once we're executing the rollback after the prepare. H2 is throwing an error about an unknown transaction

(2) SQL: XA error on rollback: javax.transaction.xa.XAException: Transaction "XID_0_00_3131313131313131313131313131313131313131313131313131313131313131" not found; SQL statement:
ROLLBACK TRANSACTION XID_0_00_3131313131313131313131313131313131313131313131313131313131313131 [90129-177]

We've investigated the case, and we're thinking there is something wrong in the XA resource rollback implementation. When the connection is
in prepared mode, a rollback statement is sent to the database but the transaction was already roll-backed internally just before. Also, the
connection was reset already in auto commit mode. We're thinking that the rollback implementation should be more close with the commit one.

Here is a link to a patch in our h2database git clone with the new rollback implementation and the updated test case according to.

Can you please advise about this, thanks.

Noel Grandin

unread,
May 2, 2014, 3:18:03 AM5/2/14
to h2-da...@googlegroups.com
Hi

Thanks for the patch and the test-case.
Could we get a license statement from you please? See here for an example:
http://h2database.com/html/build.html#providing_patches

Regards,
Noel Grandin

On 2014-04-30 18:32, Stéphane Lacoin wrote:
> Hi,
>
> We're in the process of upgrading h2 in Nuxeo. We've got an issue in our test cases about XA management. Here is the
> part of the test case that's in trouble
>
> xaresource.start(xid, XAResource.TMNOFLAGS);
> // ... write data ...
> xaresource.end(xid, XAResource.TMSUCCESS);
> xaresource.prepare(xid);
> xaresource.rollback(xid);
>
> The error is raised once we're executing the rollback after the prepare. H2 is throwing an error about an unknown
> transaction
>
> (2) SQL: XA error on rollback: javax.transaction.xa.XAException: Transaction "XID_0_00_3131313131313131313131313131313131313131313131313131313131313131" not found; SQL statement:
> ROLLBACK TRANSACTION XID_0_00_3131313131313131313131313131313131313131313131313131313131313131 [90129-177]
>
> We've investigated the case, and we're thinking there is something wrong in the XA resource rollback implementation. When the connection is
> in prepared mode, a rollback statement is sent to the database but the transaction was already roll-backed internally just before. Also, the
> connection was reset already in auto commit mode. We're thinking that the rollback implementation should be more close with the commit one.
>
> Here is alink <https://github.com/nuxeo/h2database/commit/a594a6f9be3d8ce7b2c40995d4ac85cf9ebe42b1> to a patch in our h2database git clone with the new rollback implementation and the updated test case according to.
>
> Can you please advise about this, thanks.
>
> --
> You received this message because you are subscribed to the Google Groups "H2 Database" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
> h2-database...@googlegroups.com <mailto:h2-database...@googlegroups.com>.
> To post to this group, send email to h2-da...@googlegroups.com <mailto:h2-da...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.

pbad...@thoughtworks.com

unread,
Sep 9, 2015, 3:09:24 PM9/9/15
to H2 Database
Hi,

Any updates on this? We just run into a roadblock that stops us from using h2 because of this error. Patch is still there on github, so at least from my perspective it seems to be as easy as having it merged in to h2 codebase... Let me know if you are planning on doing this.

Thanks,
Pawel

Noel Grandin

unread,
Sep 9, 2015, 3:25:23 PM9/9/15
to H2 Database
We need some kind of license statement from the person. I have emailed them repeatedly, but no reply.
> To post to this group, send email to h2-da...@googlegroups.com <mailto:h2-da...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "H2 Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email to h2-database...@googlegroups.com.
To post to this group, send email to h2-da...@googlegroups.com.

Stéphane Lacoin

unread,
Sep 10, 2015, 2:27:20 AM9/10/15
to H2 Database
Sorry for the long delay, didn't get a notice about this thread changes. Here is the license statement

"I wrote the code, it's mine, and I'm contributing it to H2 for distribution multiple-licensed under the MPL 2.0, and the EPL 1.0 (http://h2database.com/html/license.html)."
> To post to this group, send email to h2-da...@googlegroups.com <mailto:h2-da...@googlegroups.com>.

Noel Grandin

unread,
Sep 10, 2015, 2:38:47 AM9/10/15
to h2-da...@googlegroups.com
Thank you very much, patch has been committed!

Pawel Badenski

unread,
Sep 10, 2015, 10:41:34 AM9/10/15
to h2-da...@googlegroups.com
Thanks both! That's a really good news.

Noel, could you provide an estimate on when you would expect this to
be released?

On Thu, Sep 10, 2015 at 2:38 AM, Noel Grandin <noelg...@gmail.com> wrote:
> Thank you very much, patch has been committed!
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/Kp2a-J58uvc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

pbad...@thoughtworks.com

unread,
Sep 15, 2015, 3:11:47 PM9/15/15
to H2 Database
I've seen that change went in and is included in 1.4.189, thank you!


On Thursday, September 10, 2015 at 10:41:34 AM UTC-4, Pawel Badenski wrote:
Thanks both! That's a really good news.

Noel, could you provide an estimate on when you would expect this to
be released?

On Thu, Sep 10, 2015 at 2:38 AM, Noel Grandin wrote:
> Thank you very much, patch has been committed!
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/Kp2a-J58uvc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to

Stéphane Lacoin

unread,
Sep 16, 2015, 2:38:55 AM9/16/15
to H2 Database
We're going to align our framework onto, thanks for the help.


Le mardi 15 septembre 2015 21:11:47 UTC+2, pbad...@thoughtworks.com a écrit :
I've seen that change went in and is included in 1.4.189, thank you!

On Thursday, September 10, 2015 at 10:41:34 AM UTC-4, Pawel Badenski wrote:
Thanks both! That's a really good news.

Noel, could you provide an estimate on when you would expect this to
be released?

On Thu, Sep 10, 2015 at 2:38 AM, Noel Grandin wrote:
> Thank you very much, patch has been committed!
>
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "H2 Database" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/h2-database/Kp2a-J58uvc/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
Reply all
Reply to author
Forward
0 new messages