Skip to content

Commit

Permalink
Temporary Fix for mybatis#72. Check pending.
Browse files Browse the repository at this point in the history
  • Loading branch information
emacarron committed Aug 21, 2013
1 parent 33225b1 commit 9e0f628
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ public class ResultLoader {
protected final CacheKey cacheKey;
protected final BoundSql boundSql;
protected final ResultExtractor resultExtractor;
protected final Thread creatorThread;

protected boolean loaded;
protected Object resultObject;
Expand All @@ -59,6 +60,7 @@ public ResultLoader(Configuration config, Executor executor, MappedStatement map
this.cacheKey = cacheKey;
this.boundSql = boundSql;
this.resultExtractor = new ResultExtractor(configuration, objectFactory);
this.creatorThread = Thread.currentThread();
}

public Object loadResult() throws SQLException {
Expand All @@ -69,7 +71,7 @@ public Object loadResult() throws SQLException {

private <E> List<E> selectList() throws SQLException {
Executor localExecutor = executor;
if (localExecutor.isClosed()) {
if (Thread.currentThread() != this.creatorThread || localExecutor.isClosed()) {
localExecutor = newExecutor();
}
try {
Expand Down

0 comments on commit 9e0f628

Please sign in to comment.