ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r702700 - in /ibatis/trunk/java/ibatis-3: ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java
Date Wed, 08 Oct 2008 05:20:18 GMT
Author: cbegin
Date: Tue Oct  7 22:20:18 2008
New Revision: 702700

URL: http://svn.apache.org/viewvc?rev=702700&view=rev
Log:
fixed npe

Modified:
    ibatis/trunk/java/ibatis-3/ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java
    ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java?rev=702700&r1=702699&r2=702700&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-compat/src/main/java/com/ibatis/sqlmap/engine/builder/XmlSqlStatementParser.java
Tue Oct  7 22:20:18 2008
@@ -75,6 +75,11 @@
 
     MappedStatement.Builder builder = new MappedStatement.Builder(configuration, id, sqlSource);
 
+    builder.useCache(true);
+    if (!"select".equals(context.getNode().getNodeName())) {
+      builder.flushCacheRequired(true);
+    }
+
     if (parameterMapName != null) {
       parameterMapName = mapParser.applyNamespace(parameterMapName);
       builder.parameterMap(configuration.getParameterMap(parameterMapName));

Modified: ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java?rev=702700&r1=702699&r2=702700&view=diff
==============================================================================
--- ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java
(original)
+++ ibatis/trunk/java/ibatis-3/ibatis-3-core/src/main/java/org/apache/ibatis/executor/CachingExecutor.java
Tue Oct  7 22:20:18 2008
@@ -58,13 +58,6 @@
     return delegate.query(ms, parameterObject, offset, limit, resultHandler);
   }
 
-  private void flushCacheIfRequired(MappedStatement ms) {
-    Cache cache = ms.getCache();
-    if (ms.isFlushCacheRequired()) {
-      tcm.clear(cache);
-    }
-  }
-
   public List flushStatements() throws SQLException {
     return delegate.flushStatements();
   }
@@ -94,4 +87,13 @@
     throw new UnsupportedOperationException("The CachingExecutor should not be used by result
loaders and thus deferLoad() should never be called.");
   }
 
+  private void flushCacheIfRequired(MappedStatement ms) {
+    Cache cache = ms.getCache();
+    if (cache != null) {
+      if (ms.isFlushCacheRequired()) {
+        tcm.clear(cache);
+      }
+    }
+  }
+
 }



Mime
View raw message