openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fa...@apache.org
Subject svn commit: r922355 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingPreparedStatementManagerImpl.java
Date Fri, 12 Mar 2010 17:17:24 GMT
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) {



Mime
View raw message