I add database configuration in application.conf file.
if database is ready, then play will start success,
but if database is not ready, play will exit with:
Configuration error: Configuration error[Cannot connect to database [default]]
so, Is possible to wait database ready and then continue to start play?
how to implement?
So, in Play 2.6.17+ you will be able to use the configuration as explained by @schmitch.
Thanks for sharing your solution here. These are MySQL connection options, right? Not sure that you are aware of it, but keep in mind these configurations are not always recommended. From MySQL docs:
Although not recommended, you can make the driver perform failovers without invalidating the active Statement or ResultSet instances by setting either the parameter autoReconnect or autoReconnectForPools to true . This allows the client to continue using the same object instances after a failover event, without taking any exceptional measures. This, however, may lead to unexpected results: for example, if the driver is connected to the primary host with read/write access mode and it fails-over to a secondary host in real-only mode, further attempts to issue data-changing queries will result in errors, and the client will not be aware of that. This limitation is particularly relevant when using data streaming: after the failover, the ResultSet looks to be alright, but the underlying connection may have changed already, and no backing cursor is available anymore.