# Liquibase 2.0.5 does not seem to commit between changesets against MySQL 5.5

**URL:** <https://forum.liquibase.org/t/liquibase-2-0-5-does-not-seem-to-commit-between-changesets-against-mysql-5-5/2263>\
**Category:** General Discussion\
**Created:** [May 9, 2013, 5:24am UTC](https://forum.liquibase.org/t/liquibase-2-0-5-does-not-seem-to-commit-between-changesets-against-mysql-5-5/2263 "2013-05-09T05:24:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nadavcoh](https://avatars.discourse-cdn.com/v4/letter/n/eb8c5e/32.png) [@nadavcoh](https://forum.liquibase.org/u/nadavcoh)\
**Post date:** [May 9, 2013, 5:24am UTC](https://forum.liquibase.org/t/liquibase-2-0-5-does-not-seem-to-commit-between-changesets-against-mysql-5-5/2263/1 "2013-05-09T05:24:00Z")

</div>

Hello,&nbsp;

I have the following changeLog, which is run against a MySQL 5.5 instance, on a schema named “const”

1. 
2. \<databaseChangeLog
3. &nbsp; &nbsp; &nbsp; &nbsp; xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
4. &nbsp; &nbsp; &nbsp; &nbsp; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
5. &nbsp; &nbsp; &nbsp; &nbsp; xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
6. &nbsp; &nbsp; &nbsp; &nbsp; xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog [http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd)
7. &nbsp; &nbsp; &nbsp; &nbsp; [http://www.liquibase.org/xml/ns/dbchangelog-ext](http://www.liquibase.org/xml/ns/dbchangelog-ext) [http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd](http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd)"\>
8.   
9.   
10. &nbsp; &nbsp; 
11. &nbsp; &nbsp; &nbsp; &nbsp; 
12. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
13. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
14. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
15. &nbsp; &nbsp; &nbsp; &nbsp; 
16. &nbsp; &nbsp; &nbsp; &nbsp; 
17. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
18. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
19. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
20. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
21. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
22. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
23. &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
24. &nbsp; &nbsp; 
25.   
26. &nbsp; &nbsp; 
27. &nbsp; &nbsp; &nbsp; &nbsp; 
28. &nbsp; &nbsp; 
29.   
30.   
31. 

When I run this changeSet using “update”, the foreign key doesn’t get removed. When I run it in two steps (by commenting out the second changeSet during the first run), it works as expected.

Is this the designed behavior? What do I need to do to have the second changeSet?

Thanks,  
Nadav

---

<div class="post-metadata">

**Author:** ![un1415725418197r34id](https://avatars.discourse-cdn.com/v4/letter/u/7c8e57/32.png) [@un1415725418197r34id](https://forum.liquibase.org/u/un1415725418197r34id)\
**Post date:** [May 9, 2013, 5:24am UTC](https://forum.liquibase.org/t/liquibase-2-0-5-does-not-seem-to-commit-between-changesets-against-mysql-5-5/2263/2 "2013-05-09T05:24:00Z")

</div>

I have the same problem and it happens every time a changelog contains a ChangeSet that  
creates a new table with foreign key constraints and one or more other ChangeSet(s) that use dropAllForeignKeyConstraints tag&nbsp; to drop all foreing key constraints from that same table.

But the problem is not caused by MySQL or missing database commit, but due to the way the class  
liquibase.change.core.DropAllForeignKeyConstraintsChange is implemented.

On the validation stage, liquibase.change.core.DropAllForeignKeyConstraintsChange.generateStatements(Database)  
method is called, and here there are some lazy initialization statements for the private List attribute childDropChanges: on this stage both the new table has not been created yet and private attribute childDropChanges is not initialized yet, so the private method generateChildren(Database database) is called, but it doesn’t find any foreign key constraint defined for the baseTableName declared (the table doesn’t exist yet!), so the childDropChanges List attribute is initialized, empty…

When run stage arise, the List attribute childDropChanges of DropAllForeignKeyConstraintsChange has been  
inizialized, so the lazy initialization code inside generateStatements(Database) is skipped, leaving the  
List childDropChanges empty, even if, in the mean time, other ChangeSet created the table and its foreign key  
constraints that one expects should be dropped!

So the change run successfully with an empty list of constraint to drop, leaving the table unchanged!

I’m stuck to the 2.0.5 version due to incompatibility of new versions of Liquibase with some extensions of mine: any solutions to suggest?

Many thanks in advance  
Regards  
Roberto

---

<div class="post-metadata">

**Author:** ![nvoxland](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@nvoxland](https://forum.liquibase.org/u/nvoxland)\
**Post date:** [May 9, 2013, 5:24am UTC](https://forum.liquibase.org/t/liquibase-2-0-5-does-not-seem-to-commit-between-changesets-against-mysql-5-5/2263/3 "2013-05-09T05:24:00Z")

</div>

The current codebase has removed the childDropChanges attribute. Are you able to do a local build where you remove the attribute and keep childDropChanges as a local variable in generateStatements?

You can see the current code for reference at [https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/main/java/liquibase/change/core/DropAllForeignKeyConstraintsChange.java](https://github.com/liquibase/liquibase/blob/master/liquibase-core/src/main/java/liquibase/change/core/DropAllForeignKeyConstraintsChange.java)

I’m not currently planning on an official 2.0.x update.

Nathan
