Skip to content

Commit f83ba20

Browse files
committed
Remove usage of reflection to call session.close in HibernateItemReaderHelper
1 parent 1480dc5 commit f83ba20

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

spring-batch-infrastructure/src/main/java/org/springframework/batch/item/database/HibernateItemReaderHelper.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616
package org.springframework.batch.item.database;
1717

18-
import java.lang.reflect.Method;
1918
import java.util.Collection;
2019
import java.util.Map;
2120

@@ -29,7 +28,6 @@
2928
import org.springframework.batch.item.database.orm.HibernateQueryProvider;
3029
import org.springframework.beans.factory.InitializingBean;
3130
import org.springframework.util.Assert;
32-
import org.springframework.util.ReflectionUtils;
3331
import org.springframework.util.StringUtils;
3432

3533
/**
@@ -196,9 +194,7 @@ public void close() {
196194
statelessSession = null;
197195
}
198196
if (statefulSession != null) {
199-
200-
Method close = ReflectionUtils.findMethod(Session.class, "close");
201-
ReflectionUtils.invokeMethod(close, statefulSession);
197+
statefulSession.close();
202198
statefulSession = null;
203199
}
204200
}

0 commit comments

Comments
 (0)