Class DynamicSQLBatchWritingMechanism
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
-
- org.eclipse.persistence.internal.databaseaccess.DynamicSQLBatchWritingMechanism
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class DynamicSQLBatchWritingMechanism extends BatchWritingMechanism
INTERNAL: DynamicSQLBatchWritingMechanism is a private class, used by the DatabaseAccessor. It provides the required behavior for batching statements, for write, with parameter binding turned off.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected longbatchSizeThis attribute is used to store the maximum length of all strings batched togetherprotected DatabaseCalllastCallAppendedprotected java.util.List<java.lang.String>sqlStringsThis variable is used to store the SQLStrings that are being batchedprotected booleanusesOptimisticLockingRecords if this batch uses optimistic locking.-
Fields inherited from class org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
databaseAccessor, executionCount, maxBatchSize, queryTimeoutCache, statementCount
-
-
Constructor Summary
Constructors Constructor Description DynamicSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidappendCall(AbstractSession session, DatabaseCall dbCall)INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched.voidclear()INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.voidexecuteBatchedStatements(AbstractSession session)INTERNAL: This method is used by the DatabaseAccessor to execute and clear the batched statements in the case that a non batchable statement is being executedprotected java.sql.PreparedStatementprepareBatchStatement(AbstractSession session)INTERNAL: This method is used to build the batch statement by concatenating the strings together.protected java.sql.StatementprepareJDK12BatchStatement(AbstractSession session)INTERNAL: This method is used to build the batch statement for the JDBC2.0 specificationprotected voidswitchMechanisms(AbstractSession session, DatabaseCall dbCall)INTERNAL: This method is used to switch from this mechanism to the alternate automatically-
Methods inherited from class org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
cacheQueryTimeout, clearCacheQueryTimeout, clone, getMaxBatchSize, initialize, setAccessor, setMaxBatchSize
-
-
-
-
Field Detail
-
sqlStrings
protected java.util.List<java.lang.String> sqlStrings
This variable is used to store the SQLStrings that are being batched
-
batchSize
protected long batchSize
This attribute is used to store the maximum length of all strings batched together
-
usesOptimisticLocking
protected boolean usesOptimisticLocking
Records if this batch uses optimistic locking.
-
lastCallAppended
protected DatabaseCall lastCallAppended
-
-
Constructor Detail
-
DynamicSQLBatchWritingMechanism
public DynamicSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor)
-
-
Method Detail
-
appendCall
public void appendCall(AbstractSession session, DatabaseCall dbCall)
INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched. This call may result in the Mechanism executing the batched statements and possibly, switching out the mechanisms- Specified by:
appendCallin classBatchWritingMechanism
-
clear
public void clear()
INTERNAL: This method is used to clear the batched statements without the need to execute the statements first This is used in the case of rollback.- Specified by:
clearin classBatchWritingMechanism
-
executeBatchedStatements
public void executeBatchedStatements(AbstractSession session)
INTERNAL: This method is used by the DatabaseAccessor to execute and clear the batched statements in the case that a non batchable statement is being executed- Specified by:
executeBatchedStatementsin classBatchWritingMechanism
-
switchMechanisms
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall)
INTERNAL: This method is used to switch from this mechanism to the alternate automatically
-
prepareBatchStatement
protected java.sql.PreparedStatement prepareBatchStatement(AbstractSession session) throws DatabaseException
INTERNAL: This method is used to build the batch statement by concatenating the strings together.- Throws:
DatabaseException
-
prepareJDK12BatchStatement
protected java.sql.Statement prepareJDK12BatchStatement(AbstractSession session) throws DatabaseException
INTERNAL: This method is used to build the batch statement for the JDBC2.0 specification- Throws:
DatabaseException
-
-