h2database / h2database/h2database

H2 does not properly support TMJOIN XA flag

Open
#449 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
4.6k
Forks
1.3k
Avg merge
1d 2h
Merged PRs (30d)
9

Description

Scenario:
begin JTA tx
Connection conn1 = getConnection() //with XAResource xaRes1
Connection conn2 = getConnection() // with XAResource xaRes2 to SAME h2 DB as xaRes1
enlist xaRes1 in tx, do SQL on conn1, delist xaRes1
enlist xaRes2 in tx (with TMJOIN flag), do SQL on conn2, delist xaRes2
JTA commit will commit only one branch (xid) on one particular xaResource, say xaRes1

Consequence: conn2 will now have a "pending" xid ("currentTransaction") and will fail on reuse.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the JTA scenario with two XAResources connected to the same H2 database, using TMJOIN on the second resource. Trace the XA transaction handling to determine why only one branch commits and why conn2 retains a pending xid; done means both branches commit correctly and the connection can be reused.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.