Description
Tommy opened BATCH-2737 and commented
The following warning coming up from the DisposableBeanAdapter
, when it tries to destroy any reader extended from the AbstractCursorItemReader
by the auto-discovered close()
method.
DisposableBeanAdapter : Invocation of destroy method 'close' failed on bean with name 'reader': org.springframework.batch.item.ItemStreamException: Error while closing item reader
Since the invocation of the close()
method is already part of the Spring-Batch life-cycle, the doClose()
method of this class should be reentrant.
The problem lies in the incomplete check around resetting the autoCommit
state of the underlying connection, which does not respect the already closed connection.
The check should look like something similar
if(this.con != null && !this.conn.isClosed()) {
this.con.setAutoCommit(this.initialConnectionAutoCommit);
}
Affects: 4.0.0
1 votes, 2 watchers