Skip to content

Commit f7c137d

Browse files
committed
Unwrap target user class
1 parent 622bb7f commit f7c137d

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,11 @@ protected TransactionAttribute computeTransactionAttribute(Method method, @Nulla
178178
}
179179

180180
// Second try is the transaction attribute on the target class.
181-
txAttr = findTransactionAttribute(targetClass != null ? targetClass : specificMethod.getDeclaringClass());
181+
Class<?> specificTargetClass = method.getDeclaringClass();
182+
if (targetClass != null) {
183+
specificTargetClass = ClassUtils.getUserClass(targetClass);
184+
}
185+
txAttr = findTransactionAttribute(specificTargetClass);
182186
if (txAttr != null && ClassUtils.isUserLevelMethod(method)) {
183187
return txAttr;
184188
}

0 commit comments

Comments
 (0)