Author: mikedd
Date: Thu Feb 7 14:11:21 2008
New Revision: 619664
URL: http://svn.apache.org/viewvc?rev=619664&view=rev
Log:
OPENJPA-464 commiting patch provided by Teresa Kan
Added:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java
(with props)
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
Modified:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java?rev=619664&r1=619663&r2=619664&view=diff
==============================================================================
---
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
(original)
+++
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java
Thu Feb 7 14:11:21 2008
@@ -25,6 +25,7 @@
import org.apache.commons.lang.StringUtils;
import org.apache.openjpa.conf.OpenJPAConfigurationImpl;
import org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager;
+import org.apache.openjpa.jdbc.kernel.BatchingOperationOrderUpdateManager;
import org.apache.openjpa.jdbc.kernel.EagerFetchModes;
import org.apache.openjpa.jdbc.kernel.JDBCBrokerFactory;
import org.apache.openjpa.jdbc.kernel.LRSSizes;
@@ -222,6 +223,8 @@
"org.apache.openjpa.jdbc.kernel.ConstraintUpdateManager",
"batching-constraint",
BatchingConstraintUpdateManager.class.getName(),
+ "batching-order",
+ BatchingOperationOrderUpdateManager.class.getName(),
};
updateManagerPlugin.setAliases(aliases);
updateManagerPlugin.setDefault(aliases[0]);
Added:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java?rev=619664&view=auto
==============================================================================
---
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java
(added)
+++
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java
Thu Feb 7 14:11:21 2008
@@ -0,0 +1,48 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.openjpa.jdbc.kernel;
+
+import java.sql.Connection;
+
+/**
+ * <P>Batch update manager that writes the SQL in object-level operation
order.
+ * This update manager initiates a BatchPreparedStatementManagerImpl which
+ * will utilize the JDBC addBatch() and executeBatch() APIs to batch the
+ * statements for performance improvement.</P>
+ * <P>This is the plug-in class for UpdateManager to support statement
+ * batching for ordering. You can plug-in this statement batch implementation
+ * through the following property:
+ * <PRE>
+ * < property name="openjpa.jdbc.UpdateManager"
+ * value="org.apache.openjpa.jdbc.kernel.BatchingOperationOrderUpdateManager"
+ * />
+ * </PRE></P>
+ * @author Teresa Kan
+ */
+
+public class BatchingOperationOrderUpdateManager extends
+ OperationOrderUpdateManager {
+
+ protected PreparedStatementManager newPreparedStatementManager(
+ JDBCStore store, Connection conn) {
+ int batchLimit = dict.getBatchLimit();
+ return new BatchingPreparedStatementManagerImpl(
+ store, conn, batchLimit);
+ }
+}
Propchange:
openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/BatchingOperationOrderUpdateManager.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
URL:
http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=619664&r1=619663&r2=619664&view=diff
==============================================================================
--- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
(original)
+++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Thu Feb
7 14:11:21 2008
@@ -2683,7 +2683,7 @@
<literal>serializable</literal>: Dirty reads, non-repeatable reads, and phantom
reads are prevented.
</para>
- </listitem>
+ </listitem>openjpa-project/src/doc/manual/ref_guide_dbsetup.xml
</itemizedlist>
<example id="ref_guide_dbsetup_isoex">
<title>
@@ -3149,9 +3149,14 @@
</example>
<par>
By default, org.apache.openjpa.jdbc.kernel.BatchingConstraintUpdateManager
-is the default statement batching implementation. You can plug-in your own
+is the default statement batching implementation. OPENJPA also
+provides another update manager
+org.apache.openjpa.jdbc.kernel.BatchingOperationOrderUpdateManager for the
+statements that required ordering. You can plug-in this update manager through
+the "openjpa.jdbc.UpdateManager" property. Or you can plug-in your own
statement batching implementation by providing the implementation that extends
-from AbstractUpdateManager or ConstraitUpdateManager. Add this implementation
+from AbstractUpdateManager, ConstraitUpdateManager or
OperationOrderUpdateManager.
+Add this implementation
class as a property in the persistence.xml file. For example, a custom
statement batching implementation mycomp.MyUpdateManager extends
ConstraitUpdateManager. You specify this implementation in the persistence.xml