Spring calls close() when the transaction ends, which may be due to either commit or rollback. Regardless of whether close() really closes the actual JDBC connection, it depends on the configuration of the DataSource . If this is a simple JDBC connection, then it actually closes. If this is a connection pool, then it will probably just be returned to the pool when it closes.
source share