Class BatchWritingMechanism
- java.lang.Object
-
- org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism
-
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
DynamicSQLBatchWritingMechanism
,ParameterizedSQLBatchWritingMechanism
public abstract class BatchWritingMechanism extends Object implements Cloneable, Serializable
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected DatabaseAccessor
databaseAccessor
This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writingprotected int
executionCount
protected int
maxBatchSize
Allow for the batch size to be set as many database have strict limits.protected int
queryTimeoutCache
INTERNAL: This variable is used to temporarily cache the largest queryTimeout among a batch of queries for a particular mechanism.protected int
statementCount
-
Constructor Summary
Constructors Constructor Description BatchWritingMechanism()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract 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
clearCacheQueryTimeout()
INTERNAL: Clear the cached timeout after the statement has been executed.BatchWritingMechanism
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
getMaxBatchSize()
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 Detail
-
databaseAccessor
protected DatabaseAccessor databaseAccessor
This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing
-
queryTimeoutCache
protected int queryTimeoutCache
INTERNAL: 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 maxBatchSize
Allow for the batch size to be set as many database have strict limits.
-
-
Method Detail
-
getMaxBatchSize
public int getMaxBatchSize()
-
setMaxBatchSize
public void setMaxBatchSize(int maxBatchSize)
-
cacheQueryTimeout
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.- Parameters:
session
-dbCall
-
-
clearCacheQueryTimeout
protected void clearCacheQueryTimeout()
INTERNAL: Clear the cached timeout after the statement has been executed.
-
setAccessor
public void setAccessor(DatabaseAccessor accessor, AbstractSession session)
INTERNAL: Sets the accessor that this mechanism will use
-
appendCall
public abstract 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. 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
public 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 execute
-
clone
public BatchWritingMechanism clone()
INTERNAL: The mechanism will be cloned to be set into each accessor.
-
initialize
public void initialize(AbstractSession session)
INTERNAL: Allow initialization with the session after login.
-
-