From 93e15d846c2338b979d8a08408bce95c31c4598f Mon Sep 17 00:00:00 2001 From: Catalina Wei Date: Fri, 23 May 2008 02:14:35 +0000 Subject: [PATCH] OPENJPA-574 fix a potential NullPointerException in checkUpdateCount for statement batching. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@659364 13f79535-47bb-0310-9956-ffa450edef68 --- .../jdbc/kernel/BatchingPreparedStatementManagerImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java index de2d388ce..eecd8ce2d 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java @@ -238,7 +238,9 @@ public class BatchingPreparedStatementManagerImpl extends // 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",