You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We use AspectJ compile Time Weaving to manage @Transactional annotations. Everything works fine until we activate spring.main.lazy-initialization=true. The Transaction is not started.
The error is somewhere in TransactionAspectSupport, as the beanFactory is still null when running with lazy-init activated:
protectedTransactionManagerdetermineTransactionManager(@NullableTransactionAttributetxAttr) {
// Do not attempt to lookup tx manager if no tx attributes are setif (txAttr == null || this.beanFactory == null) {
returngetTransactionManager();
}
I hope this is a spring issue and not a Spring Boot issue. I searched the docs if lazy-init is not supported with AspectJ but I did not found anything and didn't any other issue regarding this bug.
sbrannen
changed the title
AspectJ Transactional Management and spring.main.lazy-initialization=true
AspectJ transaction management and spring.main.lazy-initialization=true
Feb 9, 2021
Thanks very much for the sample, and sorry it took so long to process it. I can confirm the issue, but this shouldn't be addressed in the core framework so I am going to move this issue to the Spring Boot issue tracker.
I've updated your sample to a supported Spring Boot version, and added a way to opt-out explicitly from Lazy processing of TransactionAspectSupport. This made your sample pass this way.
wilkinsona
changed the title
AspectJ transaction management and spring.main.lazy-initialization=true
AspectJ transaction management with compile-time weaving does not work with spring.main.lazy-initialization=true
Sep 29, 2023
Uh oh!
There was an error while loading. Please reload this page.
We use AspectJ compile Time Weaving to manage
@Transactional
annotations. Everything works fine until we activatespring.main.lazy-initialization=true
. The Transaction is not started.The error is somewhere in
TransactionAspectSupport
, as thebeanFactory
is stillnull
when running withlazy-init
activated:I hope this is a spring issue and not a Spring Boot issue. I searched the docs if
lazy-init
is not supported with AspectJ but I did not found anything and didn't any other issue regarding this bug.Very small project reproducing the issue: https://github.com/kicktipp/spring-lazy-aspectj-issue
Just checkout and run
First on with success, second one fails.
If you need further information I am eager to help.
The text was updated successfully, but these errors were encountered: