My application is using spring-boot(2.7)+hibernate+postgress. we would need to stop using the DB for some time and enable it later. I have tried using exclude= [DataSourceAutoConfiguration] to stop the db connection at the start of the application but getting Cannot create inner bean ‘(inner bean)#e30573c’ of type [org.springframework.orm.jpa.SharedEntityManagerCreator] exception.
what is the best way to temporarily stop connecting to db?
Thanks for your help in advance.
below are the list of annotation used on spring boot application class.
@EnableAsync
@EnableMBeanExport
@EnableJpaRepositories('org.*.*.*.jpa')
@EntityScan('org.*.*.domain.jpa')
@SpringBootApplication(exclude= [DataSourceAutoConfiguration])