-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: feedback-providedFeedback has been providedFeedback has been providedtype: bugA general bugA general bug
Milestone
Description
I'm seeing some weird behavior when attempting to combine the 3 annotations from the subject, for example:
@Async
@ConcurrencyLimit(1)
@Transactional
void doWork() throws Exception {
logger.info("Starting work");
Thread.sleep(Duration.ofSeconds(10));
logger.info("Finished work");
}On the first two invocations of such method, @ConcurrencyLimit doesn't appear to work, but from there on it starts working OK. Here's the log output I'm seeing after invoking the service 3 times after startup, with invocations being about a second apart:
2025-11-10T13:15:44.224+01:00 INFO 906182 --- [ task-1] com.example.SampleService : Starting work
2025-11-10T13:15:45.766+01:00 INFO 906182 --- [ task-2] com.example.SampleService : Starting work
2025-11-10T13:15:54.225+01:00 INFO 906182 --- [ task-1] com.example.SampleService : Finished work
2025-11-10T13:15:55.767+01:00 INFO 906182 --- [ task-2] com.example.SampleService : Finished work
2025-11-10T13:15:55.768+01:00 INFO 906182 --- [ task-3] com.example.SampleService : Starting work
2025-11-10T13:16:05.769+01:00 INFO 906182 --- [ task-3] com.example.SampleService : Finished work
Removing @Transactional from the mix makes everything work as expected. I'll attach a reproducer shortly.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: feedback-providedFeedback has been providedFeedback has been providedtype: bugA general bugA general bug