Flyway Lock Retry Count Setting
Published 15 January 2025
Description
At the start of a migration, Flyway will attempt to take a lock to prevent competing instances executing in parallel. If this lock can't be obtained straight away, Flyway will retry at 1s intervals, until this count is reached, at which point it will abandon the migration. A value of -1 indicates that Flyway should keep retrying indefinitely.
Note: Locking is not currently implemented in Native Connectors.
Type
Integer
Default
50
Usage
Flyway Desktop
This can't be set in a config file via Flyway Desktop, although it will be honoured, and it can be configured as an advanced parameter in operations on the Migrations page.
Command-line
./flyway -lockRetryCount=10 migrate
TOML Configuration File
[flyway]
lockRetryCount = 10
Configuration File
flyway.lockRetryCount=10
Environment Variable
FLYWAY_LOCK_RETRY_COUNT=10
API
Flyway.configure()
.lockRetryCount(10)
.load()
Gradle
flyway {
lockRetryCount = 10
}
Maven
<configuration>
<lockRetryCount>10</lockRetryCount>
</configuration>