1
1
/*
2
- * Copyright 2009-2012 the original author or authors.
2
+ * Copyright 2009-2013 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -45,7 +45,7 @@ public class ResultLoader {
45
45
protected final CacheKey cacheKey ;
46
46
protected final BoundSql boundSql ;
47
47
protected final ResultExtractor resultExtractor ;
48
- protected final Thread creatorThread ;
48
+ protected final String creatorThread ;
49
49
50
50
protected boolean loaded ;
51
51
protected Object resultObject ;
@@ -60,7 +60,7 @@ public ResultLoader(Configuration config, Executor executor, MappedStatement map
60
60
this .cacheKey = cacheKey ;
61
61
this .boundSql = boundSql ;
62
62
this .resultExtractor = new ResultExtractor (configuration , objectFactory );
63
- this .creatorThread = Thread .currentThread ();
63
+ this .creatorThread = Thread .currentThread (). getName () ;
64
64
}
65
65
66
66
public Object loadResult () throws SQLException {
@@ -71,7 +71,7 @@ public Object loadResult() throws SQLException {
71
71
72
72
private <E > List <E > selectList () throws SQLException {
73
73
Executor localExecutor = executor ;
74
- if (Thread . currentThread () != this . creatorThread || localExecutor . isClosed ( )) {
74
+ if (localExecutor . isClosed () || ! Thread . currentThread (). getName (). equals ( this . creatorThread )) {
75
75
localExecutor = newExecutor ();
76
76
}
77
77
try {
0 commit comments