问题
How can I set the time that Liquibase waits to establish a connection to a database server (specifically, PostgreSQL) before failing (i.e. the connection timeout)?
How can I set the number of times that Liquibase will attempt to connect to a database server before aborting (i.e. the connection retry count)?
回答1:
Liquibase uses a jdbc connection. According to this answer network timeout was only introduced to JDBC from spec 4.1 on.
According to postgres jdbc doc there is a property like loginTimeout
that should handle this.
Liquibase will hand over jdbc driver properties to the connection by specifying the command-line param driverPropertiesFile
.
Haven't tried it myself but it looks good enough to give it a try...
来源:https://stackoverflow.com/questions/39534122/how-can-i-set-the-liquibase-database-connection-timeout-and-retry-count