Class DataSourceXAResourceRecoveryHelper

java.lang.Object
org.frankframework.jta.narayana.DataSourceXAResourceRecoveryHelper
All Implemented Interfaces:
com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper, XAResource, org.jboss.tm.XAResourceWrapper

public class DataSourceXAResourceRecoveryHelper extends Object implements com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper, XAResource, org.jboss.tm.XAResourceWrapper
XAResourceRecoveryHelper implementation which gets XIDs, which needs to be recovered, from the database. See org.springframework.boot.jta.narayana.DataSourceXAResourceRecoveryHelper. This class has been extended with a ConnectionManager to ensure operations can succeed. This has been copied from the JmsXAResourceRecoveryHelper.

Required as we wrap the connection in a pooling-capable factory, and do not use the native Narayana connection factory.

Additionally, this also implements `XAResourceWrapper`, which (AFAIK) only adds debug info. See XAResourceRecord#getJndiName()

Author:
Gytis Trikleris, Niels Meijer
  • Constructor Details

  • Method Details

    • initialise

      public boolean initialise(String properties)
      Specified by:
      initialise in interface com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
    • getXAResources

      public XAResource[] getXAResources()
      If Database connection was created successfully, returns an array with one instance of DataSourceXAResourceRecoveryHelper. Otherwise, returns an empty array.
      Specified by:
      getXAResources in interface com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper
      Returns:
      Array with one instance of DataSourceXAResourceRecoveryHelper or an empty array
    • recover

      public Xid[] recover(int flag) throws XAException
      Specified by:
      recover in interface XAResource
      Throws:
      XAException
    • start

      public void start(Xid xid, int flags) throws XAException
      Specified by:
      start in interface XAResource
      Throws:
      XAException
    • end

      public void end(Xid xid, int flags) throws XAException
      Specified by:
      end in interface XAResource
      Throws:
      XAException
    • prepare

      public int prepare(Xid xid) throws XAException
      Specified by:
      prepare in interface XAResource
      Throws:
      XAException
    • commit

      public void commit(Xid xid, boolean onePhase) throws XAException
      Specified by:
      commit in interface XAResource
      Throws:
      XAException
    • rollback

      public void rollback(Xid xid) throws XAException
      Specified by:
      rollback in interface XAResource
      Throws:
      XAException
    • isSameRM

      public boolean isSameRM(XAResource xaResource) throws XAException
      Specified by:
      isSameRM in interface XAResource
      Throws:
      XAException
    • forget

      public void forget(Xid xid) throws XAException
      Specified by:
      forget in interface XAResource
      Throws:
      XAException
    • getTransactionTimeout

      public int getTransactionTimeout() throws XAException
      Specified by:
      getTransactionTimeout in interface XAResource
      Throws:
      XAException
    • setTransactionTimeout

      public boolean setTransactionTimeout(int seconds) throws XAException
      Specified by:
      setTransactionTimeout in interface XAResource
      Throws:
      XAException
    • getResource

      public XAResource getResource()
      Specified by:
      getResource in interface org.jboss.tm.XAResourceWrapper
    • getProductName

      public @Nullable String getProductName()
      Specified by:
      getProductName in interface org.jboss.tm.XAResourceWrapper
    • getProductVersion

      public @Nullable String getProductVersion()
      Specified by:
      getProductVersion in interface org.jboss.tm.XAResourceWrapper
    • getJndiName

      public String getJndiName()
      Specified by:
      getJndiName in interface org.jboss.tm.XAResourceWrapper