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
This commit is contained in:
Catalina Wei 2008-05-23 02:14:35 +00:00
parent 81fc3ab605
commit 93e15d846c
1 changed files with 3 additions and 1 deletions
openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel

View File

@ -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",