openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r659364 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java
Date Fri, 23 May 2008 02:14:36 GMT
Author: fancy
Date: Thu May 22 19:14:35 2008
New Revision: 659364

URL: http://svn.apache.org/viewvc?rev=659364&view=rev
Log:
OPENJPA-574 fix a potential NullPointerException in checkUpdateCount for statement batching.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java?rev=659364&r1=659363&r2=659364&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java
Thu May 22 19:14:35 2008
@@ -238,7 +238,9 @@
         // DB2/ZOS        1 / 0           1 / 0        -2 / SQLException
         // Oracle        -2 / -2         -2 / -2       -2 / SQLException
         int cnt = 0;
-        int updateSuccessCnt = ps.getUpdateCount();
+        int updateSuccessCnt = 0;
+        if (ps != null && _dict.platform.indexOf("Oracle") > -1)
+            updateSuccessCnt = ps.getUpdateCount();
         if (_log.isTraceEnabled() &&
             _dict.platform.indexOf("Oracle") > -1)
             _log.trace(_loc.get("batch_update_success_count",



Mime
View raw message