Top Description Fields Constructors Methods
org.eclipse.persistence.internal.databaseaccess

public abstract Class BatchWritingMechanism

extends Object
implements Cloneable, Serializable
Class Inheritance
All Implemented Interfaces
java.io.Serializable, java.lang.Cloneable
Known Direct Subclasses
org.eclipse.persistence.internal.databaseaccess.DynamicSQLBatchWritingMechanism, org.eclipse.persistence.internal.databaseaccess.ParameterizedSQLBatchWritingMechanism
Imports
java.io.Serializable, org.eclipse.persistence.descriptors.DescriptorQueryManager, org.eclipse.persistence.internal.sessions.AbstractSession

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)

Field Summary

Modifier and TypeField and Description
protected DatabaseAccessor
databaseAccessor

This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing

protected int
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

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
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.

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.

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.

protected void
clearCacheQueryTimeout()

INTERNAL: Clear the cached timeout after the statement has been executed.

public BatchWritingMechanism
clone()

Overrides java.lang.Object.clone.

INTERNAL: The mechanism will be cloned to be set into each accessor.
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

public int
public void
initialize(AbstractSession session)

INTERNAL: Allow initialization with the session after login.

public void
setAccessor(DatabaseAccessor accessor, AbstractSession session)

INTERNAL: Sets the accessor that this mechanism will use

public void
setMaxBatchSize(int maxBatchSize)

Inherited from java.lang.Object:
equalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databaseAccessorback to summary
protected DatabaseAccessor databaseAccessor

This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing

executionCountback to summary
protected int executionCount
maxBatchSizeback to summary
protected int maxBatchSize

Allow for the batch size to be set as many database have strict limits.

queryTimeoutCacheback to summary
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.

statementCountback to summary
protected int statementCount

Constructor Detail

BatchWritingMechanismback to summary
public BatchWritingMechanism()

Method Detail

appendCallback to summary
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

cacheQueryTimeoutback to summary
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.

clearback to summary
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.

clearCacheQueryTimeoutback to summary
protected void clearCacheQueryTimeout()

INTERNAL: Clear the cached timeout after the statement has been executed.

cloneback to summary
public BatchWritingMechanism clone()

Overrides java.lang.Object.clone.

INTERNAL: The mechanism will be cloned to be set into each accessor.

Returns:BatchWritingMechanism

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
executeBatchedStatementsback to summary
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

getMaxBatchSizeback to summary
public int getMaxBatchSize()
initializeback to summary
public void initialize(AbstractSession session)

INTERNAL: Allow initialization with the session after login.

setAccessorback to summary
public void setAccessor(DatabaseAccessor accessor, AbstractSession session)

INTERNAL: Sets the accessor that this mechanism will use

setMaxBatchSizeback to summary
public void setMaxBatchSize(int maxBatchSize)