SpringLiquibase not closing connection if rollback exception

Description

There is an issue with the Spring Integration which can cause a connection to be not closed.

SpringLiquibase.java

Here we can see that the close is called after the rollback. However the rollback can throw an exception if a database access error occurs, this method is called while participating in a distributed transaction, this method is called on a closed connection or this Connection object is in auto-commit mode. In my scenario the auto-commit is on.

I suggest the code should look more like this:

Environment

Windows 7, Sybase ASE 15, JTDS driver, Tomcat connection pool.

Reporter

stuart donald

Components

Fix versions

Affects versions

Priority

Minor
Configure