Skip to content

Commit 125ef74

Browse files
committed
Reset error context after calling XMLConfigBuilder or XMLMapperBuilder. See http://code.google.com/p/mybatis/issues/detail?id=104
1 parent 32bbfb8 commit 125ef74

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/main/java/org/mybatis/spring/SqlSessionFactoryBean.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
import org.apache.ibatis.builder.xml.XMLConfigBuilder;
2828
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
29+
import org.apache.ibatis.executor.ErrorContext;
2930
import org.apache.ibatis.logging.Log;
3031
import org.apache.ibatis.logging.LogFactory;
3132
import org.apache.ibatis.mapping.Environment;
@@ -212,6 +213,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException, Illegal
212213
throw new NestedIOException("Failed to parse config resource: "
213214
+ this.configLocation, ex);
214215
} finally {
216+
ErrorContext.instance().reset();
215217
if (reader != null) {
216218
try {
217219
reader.close();
@@ -273,6 +275,7 @@ protected SqlSessionFactory buildSqlSessionFactory() throws IOException, Illegal
273275
} catch (Exception e) {
274276
throw new NestedIOException("Failed to parse mapping resource: '" + mapperLocation + "'", e);
275277
} finally {
278+
ErrorContext.instance().reset();
276279
if (reader != null) {
277280
try {
278281
reader.close();

0 commit comments

Comments
 (0)