On 8/6/07, Dominique Pfister <[EMAIL PROTECTED]> wrote: > On 8/6/07, Cris Daniluk <[EMAIL PROTECTED]> wrote: > > > > If the DBMS supports the two-phase transaction (I believe Postgres > > does), then you could just use a JTA-enabled version of the JDBC > > driver and register the DB transaction to the existing XA. > > How would you do that, technically, if everything you have at hand is > your own XAResource implementation? Am I missing some important > information the TM is giving me about the current transaction and some > way to dynamically register new resources? >
Hmm. I'm not sure... I will need to look in more detail at the way JR does it. > > > > The only other option is to persist the changelog, effectively > > converting it into a journal. However, I think bringing the DBMS into > > the XA is probably the quickest way to solve this problem.. > > > > Hm, I doubt that. JR at its core stores content with calls to an > abstract interface, namely the Persistence Manager. It is this > component that may store nodes and properties inside a DBMS, via JDBC > calls over a single connection it acquired on startup. Changing this > to using a transaction-local JDBC connection looks more complex to me > than persisting the change log. > Based on that design, persisting the change log is probably the way to go. If you're using a single connection to write back to the DBMS, that log could easily become very lengthy. I think the performance overhead of writing to disk and flushing it would be utterly insignificant (synchronous db writing is far more expensive performance-wise, yet JR still exhibits solid performance).
