How can I set the Liquibase database connection timeout and retry count?

社会主义新天地 提交于 2020-01-05 07:20:12

问题


  1. 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)?

  2. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!