mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-22 14:09:25 +00:00
feat: Implemented to throw a runtime error if a class has @Transactional
This commit is contained in:
+5
@@ -38,6 +38,11 @@ public class RestrictedTransactionalEventListenerFactory extends TransactionalEv
|
||||
@Override
|
||||
public ApplicationListener<?> createApplicationListener(String beanName, Class<?> type, Method method) {
|
||||
Transactional txAnn = AnnotatedElementUtils.findMergedAnnotation(method, Transactional.class);
|
||||
|
||||
if (txAnn == null) {
|
||||
txAnn = AnnotatedElementUtils.findMergedAnnotation(type, Transactional.class);
|
||||
}
|
||||
|
||||
if (txAnn != null) {
|
||||
Propagation propagation = txAnn.propagation();
|
||||
if (propagation != Propagation.REQUIRES_NEW && propagation != Propagation.NOT_SUPPORTED) {
|
||||
|
||||
Reference in New Issue
Block a user