From 6503eabef5327eaf3c20965d75ad086c3c4480dd Mon Sep 17 00:00:00 2001 From: Catalina Wei Date: Fri, 12 Mar 2010 17:17:23 +0000 Subject: [PATCH] OPENJPA-1550: When batchLimit=-1 or >1 and an exception is caused, the params and failedObject are missing from the resultant exception. avoid NullPointerException for JDBC provider using PureQUery APIs. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@922355 13f79535-47bb-0310-9956-ffa450edef68 --- .../jdbc/kernel/BatchingPreparedStatementManagerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 411d869f3..c09ce8146 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 @@ -224,9 +224,10 @@ public class BatchingPreparedStatementManagerImpl extends } finally { _batchedSql = null; batchedRows.clear(); - //Clear the Params now....should this be done above? - ps.clearParameters(); if (ps != null) { + //Clear the Params now....should this be done above? No. + //if JDBC provider using PureQuery, ps is null + ps.clearParameters(); try { ps.close(); } catch (SQLException sqex) {