Class BatchingPreparedStatementManagerImpl
java.lang.Object
org.apache.openjpa.jdbc.kernel.PreparedStatementManagerImpl
org.apache.openjpa.jdbc.kernel.BatchingPreparedStatementManagerImpl
- All Implemented Interfaces:
PreparedStatementManager
Batch prepared statement manager implementation. This prepared statement
manager will utilize the JDBC addBatch() and exceuteBatch() to batch the SQL
statements together to improve the execution performance.
- Author:
- Teresa Kan
-
Field Summary
Fields inherited from class PreparedStatementManagerImpl
_conn, _dict, _exceptions, _log, _store -
Constructor Summary
ConstructorsConstructorDescriptionBatchingPreparedStatementManagerImpl(JDBCStore store, Connection conn, int batchLimit) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddBatch(PreparedStatement ps, RowImpl row, int count) protected voidbatchOrExecuteRow(RowImpl row) protected int[]protected voidflushAndUpdate(RowImpl row) Flush the given row immediately or deferred the flush in batch.protected voidflush all cached up statements to be executed as a single or batched prepared statements.intbooleanvoidsetBatchDisabled(boolean disableBatch) voidsetBatchLimit(int batchLimit) Methods inherited from class PreparedStatementManagerImpl
executeUpdate, flush, flush, flushInternal, getAutoAssignColNames, getAutoAssignColumns, getExceptions, getGeneratedKeys, getGeneratedKeys, hasVersion, logSQLWarnings, logSQLWarnings, populateAutoAssignCols, populateAutoAssignCols, prepareStatement, prepareStatement, setObjectId, setObjectId
-
Constructor Details
-
BatchingPreparedStatementManagerImpl
Constructor. Supply connection.
-
-
Method Details
-
flushAndUpdate
Flush the given row immediately or deferred the flush in batch.- Overrides:
flushAndUpdatein classPreparedStatementManagerImpl- Throws:
SQLException
-
batchOrExecuteRow
- Throws:
SQLException
-
flushBatch
flush all cached up statements to be executed as a single or batched prepared statements.- Throws:
SQLException
-
isBatchDisabled
public boolean isBatchDisabled() -
setBatchDisabled
public void setBatchDisabled(boolean disableBatch) -
getBatchLimit
public int getBatchLimit() -
setBatchLimit
public void setBatchLimit(int batchLimit) -
getBatchedRows
-
getBatchedSql
-
addBatch
- Throws:
SQLException
-
executeBatch
- Throws:
SQLException
-