DynamicSQLBatchWritingMechanism is a private class, used by the DatabaseAccessor. It provides the required behavior for batching statements, for write, with parameter binding turned off.
| Modifier and Type | Field and Description |
|---|---|
| protected long | batchSize
This attribute is used to store the maximum length of all strings batched together |
| protected DatabaseCall | |
| protected List | sqlStrings
This variable is used to store the SQLStrings that are being batched |
| protected boolean | usesOptimisticLocking
Records if this batch uses optimistic locking. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | appendCall(AbstractSession session, DatabaseCall dbCall)
Implements abstract org. |
| public void | clear()
Implements abstract org. |
| 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. |
| 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 |
| batchSize | back to summary |
|---|---|
| protected long batchSize This attribute is used to store the maximum length of all strings batched together | |
| lastCallAppended | back to summary |
|---|---|
| protected DatabaseCall lastCallAppended | |
| sqlStrings | back to summary |
|---|---|
| protected List<String> sqlStrings This variable is used to store the SQLStrings that are being batched | |
| usesOptimisticLocking | back to summary |
|---|---|
| protected boolean usesOptimisticLocking Records if this batch uses optimistic locking. | |
| DynamicSQLBatchWritingMechanism | back to summary |
|---|---|
| public DynamicSQLBatchWritingMechanism(DatabaseAccessor databaseAccessor) | |
| appendCall | back to summary |
|---|---|
| public void appendCall(AbstractSession session, DatabaseCall dbCall) Implements abstract org. 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 | back to summary |
|---|---|
| public void clear() Implements abstract org. 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.
| |
| executeBatch | back 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. | |
| executeBatchedStatements | back to summary |
|---|---|
| public void executeBatchedStatements(AbstractSession session) Implements abstract org. 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
| |
| prepareBatchStatement | back to summary |
|---|---|
| protected PreparedStatement prepareBatchStatement(AbstractSession session) throws DatabaseException INTERNAL: This method is used to build the batch statement by concatenating the strings together. | |
| prepareJDK12BatchStatement | back to summary |
|---|---|
| protected Statement prepareJDK12BatchStatement(AbstractSession session) throws DatabaseException INTERNAL: This method is used to build the batch statement for the JDBC2.0 specification | |
| switchMechanisms | back to summary |
|---|---|
| protected void switchMechanisms(AbstractSession session, DatabaseCall dbCall) INTERNAL: This method is used to switch from this mechanism to the alternate automatically | |