Hello everyone, Is it possible to configure two da...
# questions
u
Hello everyone, Is it possible to configure two database connections in
application.yml
in such a way that if the primary connection is down, it automatically switches to the secondary one (and vice versa)? If so, could you please guide me on how to implement this?
j
I don’t think there’s anything built into GORM to manage that on your behalf.
g
@User you may need a Database Mirroring setup https://ultahost.com/blog/what-is-database-mirroring/
j
j
FYI: You may be able to support this scenario by implementing`org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource` and do a connection check / return the right datasource. Obviously this would only work on a per transaction basis though.