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

public Class ParameterizedSQLBatchWritingMechanism

extends BatchWritingMechanism
Class Inheritance
Imports
java.io.StringWriter, java.sql.PreparedStatement, .SQLException, java.util.ArrayList, .List, org.eclipse.persistence.descriptors.DescriptorQueryManager, org.eclipse.persistence.exceptions.DatabaseException, .OptimisticLockException, org.eclipse.persistence.internal.sessions.AbstractSession, org.eclipse.persistence.logging.SessionLog, org.eclipse.persistence.queries.ModifyQuery, org.eclipse.persistence.sessions.SessionProfiler

INTERNAL:

ParameterizedSQLBatchWritingMechanism is a private class, used by the DatabaseAccessor. it provides the required behavior for batching statements, for write, with parameter binding turned on.

Since
OracleAS TopLink 10g (9.0.4)

Field Summary

Modifier and TypeField and Description
protected DatabaseCall
protected List<List<E>>
parameters

This variable contains a list of the parameters list passed into the query

protected DatabaseCall
previousCall

This member variable is used to keep track of the last SQL string that was executed by this mechanism.

Inherited from org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism:
databaseAccessorexecutionCountmaxBatchSizequeryTimeoutCachestatementCount

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
appendCall(AbstractSession session, DatabaseCall dbCall)

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.appendCall.

INTERNAL: This method is called by the DatabaseAccessor to add this statement to the list of statements being batched.
public void
clear()

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.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.
private void
executeBatch(AbstractSession session)

INTERNAL: This method is added to execute and clear the batched statements on the cloned batch mechanism which is created in executeBatchedStatements(session).

public void
executeBatchedStatements(AbstractSession session)

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.executeBatchedStatements.

INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executed
public DatabaseCall
public List<List<E>>
public DatabaseCall
protected PreparedStatement
prepareBatchStatements(AbstractSession session)

INTERNAL: This method is used to build the parameterized batch statement for the JDBC2.0 specification

public void
public void
setParameters(List<List<E>> parameters)

public void
protected void
switchMechanisms(AbstractSession session, DatabaseCall dbCall)

INTERNAL: Swaps out the Mechanism for the other Mechanism

Inherited from org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism:
cacheQueryTimeoutclearCacheQueryTimeoutclonegetMaxBatchSizeinitializesetAccessorsetMaxBatchSize

Field Detail

lastCallAppendedback to summary
protected DatabaseCall lastCallAppended
parametersback to summary
protected List<List<E>> parameters

This variable contains a list of the parameters list passed into the query

previousCallback to summary
protected DatabaseCall previousCall

This member variable is used to keep track of the last SQL string that was executed by this mechanism. If the current string and previous string match then simply bind in the arguments, otherwise end previous batch and start a new batch

Constructor Detail

ParameterizedSQLBatchWritingMechanismback to summary
public ParameterizedSQLBatchWritingMechanism()
ParameterizedSQLBatchWritingMechanismback to summary
public ParameterizedSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor)

Method Detail

appendCallback to summary
public void appendCall(AbstractSession session, DatabaseCall dbCall)

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.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

Annotations
@Override
clearback to summary
public void clear()

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.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.

Annotations
@Override
executeBatchback to summary
private void executeBatch(AbstractSession session)

INTERNAL: This method is added to execute and clear the batched statements on the cloned batch mechanism which is created in executeBatchedStatements(session). Introduced in fix for bug#419326.

executeBatchedStatementsback to summary
public void executeBatchedStatements(AbstractSession session)

Implements abstract org.eclipse.persistence.internal.databaseaccess.BatchWritingMechanism.executeBatchedStatements.

INTERNAL: This method is used by the DatabaseAccessor to clear the batched statements in the case that a non batchable statement is being executed

Annotations
@Override
getLastCallAppendedback to summary
public DatabaseCall getLastCallAppended()
getParametersback to summary
public List<List<E>> getParameters()
getPreviousCallback to summary
public DatabaseCall getPreviousCall()
prepareBatchStatementsback to summary
protected PreparedStatement prepareBatchStatements(AbstractSession session) throws DatabaseException

INTERNAL: This method is used to build the parameterized batch statement for the JDBC2.0 specification

setLastCallAppendedback to summary
public void setLastCallAppended(DatabaseCall lastCallAppended)
setParametersback to summary
public void setParameters(List<List<E>> parameters)
setPreviousCallback to summary
public void setPreviousCall(DatabaseCall previousCall)
switchMechanismsback to summary
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall)

INTERNAL: Swaps out the Mechanism for the other Mechanism