jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edouard Hue <edouard....@gmail.com>
Subject Rollbacking a JCR transaction within an event listener
Date Tue, 11 Jun 2013 17:21:39 GMT

We use Jackrabbit 2.4, looking forward to upgrade to 2.6, in a JEE
environment (Jonas 5.2 AS, clustered JCA deployment with Oracle DB

We use a synchronous event listener to replicate data in an external JDBC
database (for many reasons). Under rare circumstances, writing to this
index may fail. In this situation, to avoid data inconsistency and costly
rebuilds, we would like to trigger a transaction rollback in Jackrabbit.

One option we consider is to use a global JTA transaction involving the JCR
XA session provided through JCA and the JDBC connection to our external DB.
Any fault while writing to the DB would trigger a rollback to the global
Another option is to keep the connection to the external DB out of the JTA
scope and to trigger a rollback to the JCR session only.
By the way, we are aware that Jackrabbit's "internal" connections to its
datastore should never be involved in JTA.

Anyway :
- Is it okay to trigger a rollback from an event listener (after
session.save(), the listener being synchronous) ?
- Should we expect events coming out from the repository after the rollback
is triggered ?


Édouard Hue

View raw message