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

public Class DynamicSQLBatchWritingMechanism

extends BatchWritingMechanism
Class Inheritance
Imports
java.io.StringWriter, java.sql.PreparedStatement, .SQLException, .Statement, 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:

DynamicSQLBatchWritingMechanism is a private class, used by the DatabaseAccessor. It provides the required behavior for batching statements, for write, with parameter binding turned off.

Field Summary

Modifier and TypeField and Description
protected long
batchSize

This attribute is used to store the maximum length of all strings batched together

protected DatabaseCall
protected List<String>
sqlStrings

This variable is used to store the SQLStrings that are being batched

protected boolean
usesOptimisticLocking

Records if this batch uses optimistic locking.

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

Constructor Summary

AccessConstructor and Description
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 execute and clear the batched statements in the case that a non batchable statement is being executed
protected PreparedStatement
prepareBatchStatement(AbstractSession session)

INTERNAL: This method is used to build the batch statement by concatenating the strings together.

protected Statement
prepareJDK12BatchStatement(AbstractSession session)

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

protected void
switchMechanisms(AbstractSession session, DatabaseCall dbCall)

INTERNAL: This method is used to switch from this mechanism to the alternate automatically

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

Field Detail

batchSizeback to summary
protected long batchSize

This attribute is used to store the maximum length of all strings batched together

lastCallAppendedback to summary
protected DatabaseCall lastCallAppended
sqlStringsback to summary
protected List<String> sqlStrings

This variable is used to store the SQLStrings that are being batched

usesOptimisticLockingback to summary
protected boolean usesOptimisticLocking

Records if this batch uses optimistic locking.

Constructor Detail

DynamicSQLBatchWritingMechanismback to summary
public DynamicSQLBatchWritingMechanism(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 execute and clear the batched statements in the case that a non batchable statement is being executed

Annotations
@Override
prepareBatchStatementback to summary
protected PreparedStatement prepareBatchStatement(AbstractSession session) throws DatabaseException

INTERNAL: This method is used to build the batch statement by concatenating the strings together.

prepareJDK12BatchStatementback to summary
protected Statement prepareJDK12BatchStatement(AbstractSession session) throws DatabaseException

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

switchMechanismsback to summary
protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall)

INTERNAL: This method is used to switch from this mechanism to the alternate automatically