David Lloyd david.lloyd at
Thu Nov 15 16:11:29 UTC 2018

Hi, I was wondering and could not discover whether there are any plans
to introduce any sort of XA integration with ADBA.

While I think it's fairly obvious that the whole JTA/XAResource-ish
API is not really a good fit here, I do think that there are far
simpler ways to integrate distributed transactions that are not
exactly that high-level.  For example, Berkeley DB has a system
whereby any transaction may be committed in two phases primarily by
the addition of two API methods (`prepare(txn,gid)` and
`discard(txn)`), with recovery accomplished by a third

It seems to me the same strategy could be added here, with versions of
the prepare and discard (aka forget) methods which return a
CompletionStage and sit alongside the commit method on the Connection
interface, throwing UnsupportedOperationException if the database
cannot participate in a two phase commit.  The prepare method could
take a full Xid or possibly even just a byte[] representing the global

Recovery seems to naturally fit as a stream or flow of prepared but
uncommitted Transactions - far more naturally than the clunky
start/next/end batching systems of yore.  This could be a single
additional `recover` method on Connection.

So, that would be three optional methods to gain distributed
transaction capability in the API, which at least conceptually seems
like a good investment.  Thoughts?

More information about the jdbc-spec-discuss mailing list