Skip to content

Commit

Permalink
[JBTM-2870] adding functionality of getDeferredThrowables to implemen…
Browse files Browse the repository at this point in the history
…tation of SubordinateTransaction/ImportedTransaction
  • Loading branch information
ochaloup committed Apr 5, 2017
1 parent 351e7a9 commit 0c87d19
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 1 deletion.
Expand Up @@ -1021,6 +1021,26 @@ public final Xid getTxId ()

return res;
}

/**
* Returning list of throwables which are bound to transaction failure.
* This method is intended to be used when handling some error states.
* The result exception could be enriched with these returned ones.
*/
public List<Throwable> getDeferredThrowables()
{
return _theTransaction.getDeferredThrowables();
}

/**
* Method {@link #getDeferredThrowables()} will return list
* of deferred throwables.
*
* @return true
*/
public boolean supportsDeferredThrowables() {
return true;
}

public String toString()
{
Expand Down
Expand Up @@ -20,6 +20,8 @@
*/
package com.arjuna.ats.internal.jta.transaction.arjunacore.jca;

import java.util.List;

import javax.transaction.HeuristicCommitException;
import javax.transaction.HeuristicMixedException;
import javax.transaction.HeuristicRollbackException;
Expand Down Expand Up @@ -113,4 +115,14 @@ public void doOnePhaseCommit () throws IllegalStateException,
public Xid baseXid();

public Uid get_uid();

/**
* {@inheritDoc}
*/
public List<Throwable> getDeferredThrowables();

/**
* {@inheritDoc}
*/
public boolean supportsDeferredThrowables();
}
Expand Up @@ -31,6 +31,8 @@

package com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca;

import java.util.List;

import javax.transaction.xa.Xid;

import com.arjuna.ats.arjuna.common.Uid;
Expand Down Expand Up @@ -117,5 +119,22 @@ public void recover() {
public boolean activated() {
return true; // TODO: more sensible implementation.
}


/**
* JTS implementation does not work with deferred throwables
* as ORB protocol does not support adding a deferred throwable
* under the base throwable.
*/
public List<Throwable> getDeferredThrowables() {
throw new UnsupportedOperationException();
}

/**
* Method {@link #getDeferredThrowables()} will throw {@link UnsupportedOperationException}.
*
* @return false
*/
public boolean supportsDeferredThrowables() {
return false;
}
}

0 comments on commit 0c87d19

Please sign in to comment.