Thanks for the test, that helped. What I found is that it looks like an
issue with the JDBC driver. Because you have
endDelimiter="\nGO" in your changelog but no GO in your file,
Liquibase is not splitting the two statements and just passing the
entire string as a single statement to the JDBC driver in
statement.execute(). With the asExpected test, the driver throws an
SQLException that is caught and handled correctly.
With the unexpected test, however, the JDBC driver does not throw
an exception even though the statement is rolled back. I'm not
seeing any known issues with sqlserver or the jdbc driver with a quick
google search and I'm also not seeing a way with the JDBC
interface to know that there really was an error even though no
exception was thrown.
I created https://liquibase.jira.com/browse/CORE-2162 to track the
issue but for now I think your best work-around is to make sure that
the statements are being split correctly. Either adding a GO after
each line or adding a semicolon to the end of the insert statements
and removing the endDelimiter setting will have each ran separately
and then everything works as expected.
Nathan