Log JPA transaction duration

preview_player
Показать описание

Below, you can find the text related to the question/problem. In the video, the question will be presented first, followed by the answers. If the video moves too fast, feel free to pause and review the answers. If you need more detailed information, you can find the necessary sources and links at the bottom of this description. I hope this video has been helpful, and even if it doesn't directly solve your problem, it will guide you to the source of the solution. I'd appreciate it if you like the video and subscribe to my channel!Log JPA transaction duration

Is there a way to intercept JPA's start / commit / rollback transaction to trigger some behavior? More specifically, I would like to ensure that my transactions are "short-lived", and if a transaction takes over 1s from start to commit, I would like to log a warning.
@Transactional

Tags: java,spring,jpaSource of the question:

Question and source license information:
Рекомендации по теме