Closed kicktipp closed 1 year ago
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.
See https://github.com/snicoll-scratches/spring-lazy-aspectj-issue
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.