Prior to this commit, DatabasePopulatorUtils.execute(...) did not perform a commit for the current Connection. This works for most use cases; however, when DatabasePopulatorUtils is used to execute initialization scripts without a managed transaction -- for example, via a DataSourceInitializer configured as a bean in the ApplicationContext or via Spring Boot configuration in application.properties -- if the underlying database is configured with auto-commit=false, the results of executing the SQL scripts are not committed to the database which can lead to data being silently lost. This commit addresses this issue by committing the Connection for the supplied DataSource if the connection is not configured for auto-commit and is not transactional. Existing use cases running with a managed transaction should therefore not be affected by this change. Closes gh-27008 |
||
|---|---|---|
| .. | ||
| src | ||
| spring-jdbc.gradle | ||