When initialize spring-batch tables with postgresql datasource in auto-commit mode false, the tables are not created in the database.
In ScriptUtils.executeSqlScript, after executing statement, there is not an explicit commit. So that, when postgresql datasource is in auto-commit mode false, transaction is not committed
I added an explicit commit after executing statement when auto-commit mode is false
- Fixes #27008
Comment From: sbrannen
Thanks for the PR.
ScriptUtils
is a set of low-level utilities for parsing and executing SQL scripts, with zero knowledge of transaction management. Transaction management should occur at a higher level in the application.
In light of that, I am closing this PR.
Comment From: sbrannen
Please note that #27008 will be included in Spring Framework 5.3.11, which addresses the described issue in DatabasePopulatorUtils
instead of in ScriptUtils
.