Skip to content

Commit 9e0f628

Browse files
committed
Temporary Fix for #72. Check pending.
1 parent 33225b1 commit 9e0f628

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/org/apache/ibatis/executor/loader/ResultLoader.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public class ResultLoader {
4545
protected final CacheKey cacheKey;
4646
protected final BoundSql boundSql;
4747
protected final ResultExtractor resultExtractor;
48+
protected final Thread creatorThread;
4849

4950
protected boolean loaded;
5051
protected Object resultObject;
@@ -59,6 +60,7 @@ public ResultLoader(Configuration config, Executor executor, MappedStatement map
5960
this.cacheKey = cacheKey;
6061
this.boundSql = boundSql;
6162
this.resultExtractor = new ResultExtractor(configuration, objectFactory);
63+
this.creatorThread = Thread.currentThread();
6264
}
6365

6466
public Object loadResult() throws SQLException {
@@ -69,7 +71,7 @@ public Object loadResult() throws SQLException {
6971

7072
private <E> List<E> selectList() throws SQLException {
7173
Executor localExecutor = executor;
72-
if (localExecutor.isClosed()) {
74+
if (Thread.currentThread() != this.creatorThread || localExecutor.isClosed()) {
7375
localExecutor = newExecutor();
7476
}
7577
try {

0 commit comments

Comments
 (0)