in tx-control-services/tx-control-service-local/src/main/java/org/apache/aries/tx/control/service/local/impl/TransactionContextImpl.java [75:97]
public void setRollbackOnly() throws IllegalStateException {
TransactionStatus status = tranStatus.get();
switch (status) {
case ACTIVE:
case MARKED_ROLLBACK:
if(!tranStatus.compareAndSet(status, MARKED_ROLLBACK))
setRollbackOnly();
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");
}
}