transactionAttribute = this.defaultTransactionAttribute;
}
switch (transactionAttribute) {
case MANDATORY:
if (!this.cdoTransaction.isActive()) {
throw new CdoException("An active transaction is MANDATORY when calling method '" + method.getClass().getName() + "#" + method.getName() + "'");
}
return invoke(method, args);
case REQUIRES: {
if (!this.cdoTransaction.isActive()) {
try {
this.cdoTransaction.begin();
Object result = invoke(method, args);
this.cdoTransaction.commit();
return result;
} catch (RuntimeException e) {
this.cdoTransaction.rollback();
throw e;
} catch (Exception e) {
this.cdoTransaction.commit();
throw e;
}
} else {
return invoke(method, args);
}
}
case NOT_SUPPORTED:
return invoke(method, args);
default: {
throw new CdoException("Unsupported transaction attribute '" + transactionAttribute + "'");
}
}
}