Skip to content

Commit 5766c7a

Browse files
committed
refactor invocation handler to local method scope
1 parent 2e775bf commit 5766c7a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/java/org/apache/ibatis/session/SqlSessionManager.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public class SqlSessionManager implements SqlSessionFactory, SqlSession {
1212

1313
private final SqlSessionFactory sqlSessionFactory;
1414
private final SqlSession sqlSessionProxy;
15-
private final InvocationHandler sqlSessionInterceptor;
1615

1716
private ThreadLocal<SqlSession> localSqlSession = new ThreadLocal<SqlSession>();
1817

@@ -30,8 +29,10 @@ public SqlSessionManager(Reader reader, Properties properties) {
3029

3130
public SqlSessionManager(SqlSessionFactory sqlSessionFactory) {
3231
this.sqlSessionFactory = sqlSessionFactory;
33-
this.sqlSessionInterceptor = new SqlSessionInterceptor();
34-
this.sqlSessionProxy = (SqlSession) Proxy.newProxyInstance(SqlSessionFactory.class.getClassLoader(), new Class[]{SqlSession.class}, sqlSessionInterceptor);
32+
this.sqlSessionProxy = (SqlSession) Proxy.newProxyInstance(
33+
SqlSessionFactory.class.getClassLoader(),
34+
new Class[]{SqlSession.class},
35+
new SqlSessionInterceptor());
3536
}
3637

3738
public void startManagedSession() {

0 commit comments

Comments
 (0)