public Object applyTransaction(InvocationContext ic) throws Exception {
Method m = ic.getMethod();
Object targetObject = ic.getTarget();
Class<?> targetClass = targetObject == null ? m.getDeclaringClass()
: targetObject.getClass();
Transactional transactionalAnnotation = AnnotationUtil.findAnnotation(
m, targetClass, Transactional.class);
Object ret;
if (transactionalAnnotation == null) {
throw new IllegalStateException(
"The interceptor annotation can not be determined!");
}
if (transactionalAnnotation != null) {
if (!transactionalAnnotation.requiresNew()) {
boolean startedTransaction = false;
if (utx.getStatus() != Status.STATUS_ACTIVE) {
utx.begin();
startedTransaction = true;