Class DynamicSQLBatchWritingMechanism

  • All Implemented Interfaces:
    Serializable, Cloneable

    public class DynamicSQLBatchWritingMechanism
    extends BatchWritingMechanism
    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.

    See Also:
    Serialized Form
    • Field Detail

      • sqlStrings

        protected List<String> sqlStrings
        This variable is used to store the SQLStrings that are being batched
      • batchSize

        protected long batchSize
        This attribute is used to store the maximum length of all strings batched together
      • usesOptimisticLocking

        protected boolean usesOptimisticLocking
        Records if this batch uses optimistic locking.
    • Constructor Detail

      • DynamicSQLBatchWritingMechanism

        public DynamicSQLBatchWritingMechanism​(DatabaseAccessor databaseAccessor)
    • Method Detail

      • appendCall

        public void appendCall​(AbstractSession session,
                               DatabaseCall dbCall)
        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
        Specified by:
        appendCall in class BatchWritingMechanism
      • clear

        public 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.
        Specified by:
        clear in class BatchWritingMechanism
      • executeBatchedStatements

        public void executeBatchedStatements​(AbstractSession session)
        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
        Specified by:
        executeBatchedStatements in class BatchWritingMechanism
      • switchMechanisms

        protected void switchMechanisms​(AbstractSession session,
                                        DatabaseCall dbCall)
        INTERNAL: This method is used to switch from this mechanism to the alternate automatically