3 Replies Latest reply on May 30, 2014 12:03 PM by Paul Robinson

    Enlisting resource in a JTA Tx that isn't 2PC-aware

    Andrew Rubinger Master

      Hi guys:


      I've been using a document- and graph-oriented DB called OrientDB.  The impl *does* support transactions, but does not support a prepare phase. 


      Now, I'd like to enlist it as a resource in a JTA transaction managed by a proper TM, but the only way I know to do this is to implement XAResource and enlist that.  XAResource, of course, is designed for 2PC, which isn't supported by the underlying DB impl.


      So I can:

      1) Perform the DB commit in the XAResource "prepare" method and throw an exception if no good? (Hack)

      2)  Same as above but in the "commit" method (Worse hack, I think)

      3) Do something entirely different which I haven't yet considered?


      For instance should I instead be implementing a single-phase LocalTransaction in JCA and then using it only with local Tx and this would stay unsupported by a TransactionManager?


      Appealing to your expertise here, guys.  Thanks!