Skip to content

CqlSessionFactoryBean implements PersistenceExceptionTranslator that leads to be instantiated by PersistenceExceptionTranslationInterceptor on every exception from a repository #1179

@vladtf

Description

@vladtf

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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions