Add previously closed check around HibernateCusorItemReader#close()
This commit makes calling the close method on the HibernateCursorItemReader safe to be called multiple times. Resloves BATCH-2619
This commit is contained in:
@@ -220,13 +220,14 @@ public class HibernateCursorItemReader<T> extends AbstractItemCountingItemStream
|
||||
@Override
|
||||
protected void doClose() throws Exception {
|
||||
|
||||
initialized = false;
|
||||
if(initialized) {
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
if (cursor != null) {
|
||||
cursor.close();
|
||||
helper.close();
|
||||
}
|
||||
|
||||
helper.close();
|
||||
|
||||
initialized = false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user