You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by fa...@apache.org on 2010/03/12 18:17:24 UTC

svn commit: r922355 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java

Author: fancy
Date: Fri Mar 12 17:17:23 2010
New Revision: 922355

URL: http://svn.apache.org/viewvc?rev=922355&view=rev
Log:
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.

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=922355&r1=922354&r2=922355&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 Fri Mar 12 17:17:23 2010
@@ -224,9 +224,10 @@ public class BatchingPreparedStatementMa
             } 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) {