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
| Modifier and Type | Field 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 |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method 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 | |
| public BatchWritingMechanism | clone()
Overrides java. |
| 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 | |
| public void | setAccessor(DatabaseAccessor accessor, AbstractSession session)
INTERNAL: Sets the accessor that this mechanism will use |
| public void |
| databaseAccessor | back to summary |
|---|---|
| protected DatabaseAccessor databaseAccessor This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing | |
| executionCount | back to summary |
|---|---|
| protected int executionCount | |
| maxBatchSize | back to summary |
|---|---|
| protected int maxBatchSize Allow for the batch size to be set as many database have strict limits. | |
| queryTimeoutCache | back 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. | |
| statementCount | back to summary |
|---|---|
| protected int statementCount | |
| BatchWritingMechanism | back to summary |
|---|---|
| public BatchWritingMechanism() | |
| appendCall | back 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 | |
| cacheQueryTimeout | back 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. | |
| clear | back 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. | |
| clearCacheQueryTimeout | back to summary |
|---|---|
| protected void clearCacheQueryTimeout() INTERNAL: Clear the cached timeout after the statement has been executed. | |
| clone | back to summary |
|---|---|
| public BatchWritingMechanism clone() Overrides java. INTERNAL: The mechanism will be cloned to be set into each accessor.
| |
| executeBatchedStatements | back 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 | |
| getMaxBatchSize | back to summary |
|---|---|
| public int getMaxBatchSize() | |
| initialize | back to summary |
|---|---|
| public void initialize(AbstractSession session) INTERNAL: Allow initialization with the session after login. | |
| setAccessor | back to summary |
|---|---|
| public void setAccessor(DatabaseAccessor accessor, AbstractSession session) INTERNAL: Sets the accessor that this mechanism will use | |
| setMaxBatchSize | back to summary |
|---|---|
| public void setMaxBatchSize(int maxBatchSize) | |