ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cbe...@apache.org
Subject svn commit: r468832 - in /ibatis/trunk/java/mapper/mapper2: build/ src/com/ibatis/common/jdbc/logging/ src/com/ibatis/sqlmap/engine/execution/ test/com/ibatis/sqlmap/
Date Sun, 29 Oct 2006 04:54:59 GMT
Author: cbegin
Date: Sat Oct 28 21:54:57 2006
New Revision: 468832

URL: http://svn.apache.org/viewvc?view=rev&rev=468832
Log:
Fixed statements being closed twice because of incorrect equality check in LogProxy classes.


Modified:
    ibatis/trunk/java/mapper/mapper2/build/version.properties
    ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/PreparedStatementLogProxy.java
    ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/StatementLogProxy.java
    ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/execution/SqlExecutor.java
    ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/ResultObjectFactoryTest.java

Modified: ibatis/trunk/java/mapper/mapper2/build/version.properties
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/build/version.properties?view=diff&rev=468832&r1=468831&r2=468832
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/build/version.properties (original)
+++ ibatis/trunk/java/mapper/mapper2/build/version.properties Sat Oct 28 21:54:57 2006
@@ -1,5 +1,5 @@
 #Build version info
-#Fri Oct 27 10:30:41 MDT 2006
+#Sat Oct 28 22:50:41 MDT 2006
 version=2.2.1
-buildDate=2006/10/27 10\:30
-buildNum=656
+buildDate=2006/10/28 22\:50
+buildNum=659

Modified: ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/PreparedStatementLogProxy.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/PreparedStatementLogProxy.java?view=diff&rev=468832&r1=468831&r2=468832
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/PreparedStatementLogProxy.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/PreparedStatementLogProxy.java
Sat Oct 28 21:54:57 2006
@@ -76,6 +76,14 @@
         else {
           return null;
         }
+      } else if ("equals".equals(method.getName())) {
+        Object ps = params[0];
+        if (ps instanceof Proxy) {
+          return proxy == ps;
+        }
+        return false;
+      } else if ("hashCode".equals(method.getName())) {
+        return proxy.hashCode();
       } else {
         return method.invoke(statement, params);
       }

Modified: ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/StatementLogProxy.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/StatementLogProxy.java?view=diff&rev=468832&r1=468831&r2=468832
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/StatementLogProxy.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/src/com/ibatis/common/jdbc/logging/StatementLogProxy.java
Sat Oct 28 21:54:57 2006
@@ -64,6 +64,14 @@
         else {
           return null;
         }
+      } else if ("equals".equals(method.getName())) {
+        Object ps = params[0];
+        if (ps instanceof Proxy) {
+          return proxy == ps;
+        }
+        return false;
+      } else if ("hashCode".equals(method.getName())) {
+        return proxy.hashCode();
       } else {
         return method.invoke(statement, params);
       }

Modified: ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/execution/SqlExecutor.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/execution/SqlExecutor.java?view=diff&rev=468832&r1=468831&r2=468832
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/execution/SqlExecutor.java
(original)
+++ ibatis/trunk/java/mapper/mapper2/src/com/ibatis/sqlmap/engine/execution/SqlExecutor.java
Sat Oct 28 21:54:57 2006
@@ -499,8 +499,8 @@
   }
 
   private static void closeStatement(SessionScope session, PreparedStatement ps) {
-    if (!session.hasPreparedStatement(ps)) {
-      if (ps != null) {
+    if (ps != null) {
+      if (!session.hasPreparedStatement(ps)) {
         try {
           ps.close();
         } catch (SQLException e) {

Modified: ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/ResultObjectFactoryTest.java
URL: http://svn.apache.org/viewvc/ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/ResultObjectFactoryTest.java?view=diff&rev=468832&r1=468831&r2=468832
==============================================================================
--- ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/ResultObjectFactoryTest.java (original)
+++ ibatis/trunk/java/mapper/mapper2/test/com/ibatis/sqlmap/ResultObjectFactoryTest.java Sat
Oct 28 21:54:57 2006
@@ -17,15 +17,11 @@
    * everything in the sql map is declared as an interface.
    *
    */
-  public void testShouldDemonstrateThatTheObjectFactoryIsWorking() {
-    try {
-      List results =
-          sqlMap.queryForList("getAllItemsROF");
-      assertEquals(28, results.size());
-      assertEquals(new Integer(1), ((IItem)results.get(2)).getSupplier().getSupplierId());
-    } catch (Exception e) {
-      fail(e.getMessage());
-    }
+  public void testShouldDemonstrateThatTheObjectFactoryIsWorking() throws Exception {
+    List results =
+        sqlMap.queryForList("getAllItemsROF");
+    assertEquals(28, results.size());
+    assertEquals(new Integer(1), ((IItem)results.get(2)).getSupplier().getSupplierId());
   }
 
 }



Mime
View raw message