No, it’s not currently supported in the spring/servlet code under the assumption that the purpose of those integration points is to get the database to match up with the code that is starting up. I’m not sure how rolling back the database to a point that doesn’t match the code would make sense, so it’s not supported in there.
That being said, there is no reason you can’t add support in, or create your own listener like the standard listeners with whatever logic matches your needs.
Nathan
Is there currently a way to perform automatic rollbacks from the Spring bean or Servlet listener? Based on the documentation, this post, and my testing, it seems that this functionality is not available through the Spring or Servlet Listener liquibase methods.
This seems a bit surprising as this seems to be one of the key benefits of liquibase, but the spring and servlet listener may cause the schema to be put into an invalid or partial state without automatic rollbacks. Would it be possible to add this functionality to liquibase, or is there a reason that this functionality would not be recommended/supported? In the meantime, is there any documentation available to describe how to programmatically rollback a changeset when the changeset fails in a Java application (in particular, with the use of the SpringLiquibase bean if possible)?
Thanks for the confirmation.
I’m not sure how rolling back the database to a point that doesn’t match the code would make sense, so it’s not supported in there.
If a problem occurs during the execution of a changeset during application startup, the database will enter a state that doesn’t match the code as well, so it seems much safer to revert it to its original, working state (or at least to revert the most recent failed changeset), than to leave it in an invalid, partially updated state.