Liquibase not rollbacking changeset

Anyone?

Can you give us how you are trying to call the rollback ? From a command line it looks like:

For updating:

  1. liquibase --changleLogFile=changelog.xml update
For rollbacking the last changeset:
  1. liquibase --changelLogFile=changelog.xml rollbackCount 1

Hi,


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.


  1. connection = DriverManager.getConnection( Utils.getConnectionUrl( schemaDetails ) );
  2. Liquibase liquibase = new Liquibase(
  3.                     changeLogFile, new ClassLoaderResourceAccessor(),
  4.                     DatabaseFactory.getInstance()
  5.                             .findCorrectDatabaseImplementation(
  6.                                     new JdbcConnection( connection ) ) );
  7.             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:


  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
  3.                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4.                    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd">

  5.    
  6.         <createTable tableName="test_one"
  7.                      remarks="test">
  8.            
  9.        

  10.        
  11.            
  12.        

  13.        
  14.            
  15.        

  16.    
I am surprised that such a simple rollback is not being done. I tried debugging the liquibase code and saw that there is an explicit call to connection.rollback. But the rollback never happens. In the above case I am expecting that the table 

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?

Nathan