问题
I am trying to use flyway repair method to delete unsuccessful migration entries from schema versioning table with spring boot configuration. My code is like this;
@Bean
public FlywayMigrationStrategy repairStrategy() {
return flyway -> {
flyway.repair();
flyway.migrate();
};
}
But after run, it throws an error like this(repair operation fails even when migration operation is commented out);
Error while retrieving the list of applied migrations from Schema History table
SQL State : 72000
Error Code : 12838
Message : ORA-12838: cannot read/modify an object after modifying it in parallel
Do you have any ideas? Is there any parallel operation here? Btw, I am using Oracle ATP database and flyway community edition.
回答1:
Flyway repair will not repair your database for you (see docs here). What it does is repair the schema history table back to a valid state. Fixing the database is left up to the user (as it is a non-trivial task).
In this situation, you can try submitting a commit;
. This should allow you to run repair and then migrate again.
See: https://dbaclass.com/article/ora-12838-cannot-readmodify-object-modifying-parallel/
来源:https://stackoverflow.com/questions/59666601/flyway-repair-throws-flywaysqlexception-with-oracle-db