in tx-control-services/tx-control-service-xa/src/main/java/org/apache/aries/tx/control/service/xa/impl/TransactionContextImpl.java [121:145]
public void setRollbackOnly() throws IllegalStateException {
TransactionStatus status = getTransactionStatus();
switch (status) {
case ACTIVE:
case MARKED_ROLLBACK:
try {
currentTransaction.setRollbackOnly();
} catch (Exception e) {
throw new TransactionException("Unable to set rollback for the transaction", e);
}
break;
case COMMITTING:
// TODO something here? If it's the first resource then it might
// be ok to roll back?
throw new IllegalStateException("The transaction is already being committed");
case COMMITTED:
throw new IllegalStateException("The transaction is already committed");
case ROLLING_BACK:
case ROLLED_BACK:
// A no op
break;
default:
throw new IllegalStateException("The transaction is in an unkown state");
}
}