You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CqlSessionFactoryBean implements PersistenceExceptionTranslator that leads to be instantiated by PersistenceExceptionTranslationInterceptor on every RuntimeException from a repository #1179
org.springframework.data.cassandra.config.CqlSessionFactoryBean implements PersistenceExceptionTranslator that means that on each RuntimeException PersistenceExceptionTranslationInterceptor will find the bean for class CqlSessionFactoryBean to try translate the exception. If Cassandra is not available getBean method will fail with BeanCreationException because CqlSessionFactoryBean 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 of CqlSessionFactoryBean.
A possible solution is to remove implements PersistenceExceptionTranslator from CqlSessionFactoryBean.