Several app instances trying to migrate the same database at the same time
问题 I just started using flyway in a pretty standard spring 2.5 web application with a mysql databse. It has been in production for years and has a lot of data. I hooked it up to auto-migrate on startup with <bean id="flyway" class="com.googlecode.flyway.core.Flyway" init-method="migrate"> <property name="dataSource" ref="dataSource"/> </bean> and the made the Spring's persistence unit manager (using jpa) depend on it so the database would be migrated before JPA initializes. This works fine. In