CqlSessionFactoryBean implements PersistenceExceptionTranslator that leads to be instantiated by PersistenceExceptionTranslationInterceptor
on every RuntimeException from a repository
#1179
Labels
type: enhancement
A general enhancement
Milestone
org.springframework.data.cassandra.config.CqlSessionFactoryBean
implementsPersistenceExceptionTranslator
that means that on each RuntimeExceptionPersistenceExceptionTranslationInterceptor
will find the bean for classCqlSessionFactoryBean
to try translate the exception. If Cassandra is not availablegetBean
method will fail withBeanCreationException
becauseCqlSessionFactoryBean
tried to connect to Cassandra and failed.Expected behavior is that Spring will find a bean for class
org.springframework.data.cassandra.core.cql.CassandraExceptionTranslator
and try to translate RuntimeException using this bean, instead of trying to create a new object ofCqlSessionFactoryBean
.A possible solution is to remove implements
PersistenceExceptionTranslator
fromCqlSessionFactoryBean
.The text was updated successfully, but these errors were encountered: