Skip to content

Commit e892537

Browse files
committed
http://code.google.com/p/mybatis/issues/detail?id=57 : Add a method to check if there is an active managed Session
1 parent f98a2f2 commit e892537

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ public void startManagedSession(ExecutorType execType, Connection connection) {
7373
this.localSqlSession.set(openSession(execType, connection));
7474
}
7575

76+
public boolean isManagedSessionStarted() {
77+
return this.localSqlSession.get() != null;
78+
}
79+
7680
public SqlSession openSession() {
7781
return sqlSessionFactory.openSession();
7882
}

0 commit comments

Comments
 (0)