Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Order in which callbacks are executed #1296

ridiekel opened this issue Apr 26, 2016 · 1 comment

Order in which callbacks are executed #1296

ridiekel opened this issue Apr 26, 2016 · 1 comment


Copy link


In Flyway 4.0.0 we are using callback to do validation and other tasks that need to be executed after every migration.
We would expect those callbacks to be executed in the order we give them to Flyway. However they are executed in random order.

We looked at flyway code and found that the callbacks are being put in a HashSet. We think this causes the callbacks to be put in random order (Set flywayCallbacks = new HashSet(Arrays.asList(callbacks)); in at 1348)

For now we can work around this issue by creating a callback that contains callbacks and executes them in the correct order, but we doubt this is a good practice.

Copy link

Good catch! Changed to LinkedHashSet instead.

@axelfontaine axelfontaine added this to the Flyway 4.0.1 milestone May 6, 2016
axelfontaine pushed a commit to flyway/ that referenced this issue May 6, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet

No branches or pull requests

2 participants