Module org.eclipse.persistence.core
Class BatchWritingMechanism
java.lang.Object
org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
DynamicSQLBatchWritingMechanism
,ParameterizedSQLBatchWritingMechanism
INTERNAL:
BatchWritingMechanism is a private interface, used by the DatabaseAccessor. it provides the required behavior for batching statements, for write.
There are currently two types of the Mechanism implemented, one to handle the tradition dynamic SQL batching and another to handle Parameterized SQL. Depending on what is passed to these mechanisms they may decide to switch the current one out to the alternative type.
In bug# 214910 this interface was switched to an abstract class
- Since:
- OracleAS TopLink 10g (9.0.4)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionprotected DatabaseAccessor
This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writingprotected int
protected int
Allow for the batch size to be set as many database have strict limits.protected int
INTERNAL: This variable is used to temporarily cache the largest queryTimeout among a batch of queries for a particular mechanism.protected int
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
appendCall
(AbstractSession session, DatabaseCall call) INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched.protected void
cacheQueryTimeout
(AbstractSession session, DatabaseCall dbCall) INTERNAL: This function caches the largest query timeout encountered within all the calls in this batch, or uses the parent timeout if one of the calls references the parent.abstract 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.protected void
INTERNAL: Clear the cached timeout after the statement has been executed.clone()
INTERNAL: The mechanism will be cloned to be set into each accessor.abstract void
executeBatchedStatements
(AbstractSession session) INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executeint
void
initialize
(AbstractSession session) INTERNAL: Allow initialization with the session after login.void
setAccessor
(DatabaseAccessor accessor, AbstractSession session) INTERNAL: Sets the accessor that this mechanism will usevoid
setMaxBatchSize
(int maxBatchSize)
-
Field Details
-
databaseAccessor
This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing -
queryTimeoutCache
protected int queryTimeoutCacheINTERNAL: This variable is used to temporarily cache the largest queryTimeout among a batch of queries for a particular mechanism. The default is NoTimeout. -
executionCount
protected int executionCount -
statementCount
protected int statementCount -
maxBatchSize
protected int maxBatchSizeAllow for the batch size to be set as many database have strict limits.
-
-
Constructor Details
-
BatchWritingMechanism
public BatchWritingMechanism()
-
-
Method Details
-
getMaxBatchSize
public int getMaxBatchSize() -
setMaxBatchSize
public void setMaxBatchSize(int maxBatchSize) -
cacheQueryTimeout
INTERNAL: This function caches the largest query timeout encountered within all the calls in this batch, or uses the parent timeout if one of the calls references the parent. -
clearCacheQueryTimeout
protected void clearCacheQueryTimeout()INTERNAL: Clear the cached timeout after the statement has been executed. -
setAccessor
INTERNAL: Sets the accessor that this mechanism will use -
appendCall
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 -
clear
public abstract 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. -
executeBatchedStatements
INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being execute -
clone
INTERNAL: The mechanism will be cloned to be set into each accessor. -
initialize
INTERNAL: Allow initialization with the session after login.
-