Polish
This commit is contained in:
@@ -135,7 +135,7 @@ implements InitializingBean {
|
||||
|
||||
private boolean useSharedExtendedConnection = false;
|
||||
|
||||
private boolean connectionAutoCommit;
|
||||
private Boolean connectionAutoCommit;
|
||||
|
||||
private boolean initialConnectionAutoCommit;
|
||||
|
||||
@@ -396,7 +396,9 @@ implements InitializingBean {
|
||||
rs = null;
|
||||
cleanupOnClose();
|
||||
|
||||
this.con.setAutoCommit(initialConnectionAutoCommit);
|
||||
if(this.con != null) {
|
||||
this.con.setAutoCommit(this.initialConnectionAutoCommit);
|
||||
}
|
||||
|
||||
if (useSharedExtendedConnection && dataSource instanceof ExtendedConnectionDataSourceProxy) {
|
||||
((ExtendedConnectionDataSourceProxy)dataSource).stopCloseSuppression(this.con);
|
||||
@@ -445,7 +447,7 @@ implements InitializingBean {
|
||||
|
||||
this.initialConnectionAutoCommit = this.con.getAutoCommit();
|
||||
|
||||
if (this.con.getAutoCommit() != this.connectionAutoCommit) {
|
||||
if (this.connectionAutoCommit != null && this.con.getAutoCommit() != this.connectionAutoCommit) {
|
||||
this.con.setAutoCommit(this.connectionAutoCommit);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ public class JdbcCursorItemReaderCommonTests extends AbstractDatabaseItemStreamI
|
||||
@Override
|
||||
protected ItemReader<Foo> getItemReader() throws Exception {
|
||||
|
||||
JdbcCursorItemReader<Foo> result = new JdbcCursorItemReader<Foo>();
|
||||
JdbcCursorItemReader<Foo> result = new JdbcCursorItemReader<>();
|
||||
result.setDataSource(getDataSource());
|
||||
result.setSql("select ID, NAME, VALUE from T_FOOS");
|
||||
result.setIgnoreWarnings(true);
|
||||
|
||||
Reference in New Issue
Block a user