Can you give us how you are trying to call the rollback ? From a command line it looks like:
- liquibase --changleLogFile=changelog.xml update
- liquibase --changelLogFile=changelog.xml rollbackCount 1
I am running liquibase directly from Java like this: So yes I am running it as an update and I expect that if one statement in the changeset fails the executed statements should be rolled back right? Because the entire changeset is running in a transaction.
- connection = DriverManager.getConnection( Utils.getConnectionUrl( schemaDetails ) );
- Liquibase liquibase = new Liquibase(
- changeLogFile, new ClassLoaderResourceAccessor(),
- new JdbcConnection( connection ) ) );
- liquibase.update( "" )
I am facing a weird issue with liquibase, whenever there is an issue in the changeset execution liquibase is not rolling back any changes.
My sample changelog is:
- <?xml version="1.0" encoding="UTF-8"?>
- <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
- xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">
- <createTable tableName="test_one"
test_one be deleted when it encounters an issue but to my surprise the table still exists :(
I was testing this out on a simple mysql database. Can someone please throw light on this issue? This is a major issue for us.
Iam also facing same Issue.
What version of Liquibase are you running? The newest 3.0.4?