Inspired by https://github.com/spring-projects/spring-boot/issues/41092, PersistenceExceptionTranslationInterceptor
should defensively retrieve PersistenceExceptionTranslator
beans, covering scenarios where the translator has not been initialized before shutdown but a late request starts using the persistence infrastructure during shutdown. It could simply rethrow the original exception as-is in case of a BeanCreationNotAllowedException
from detectPersistenceExceptionTranslators
.