Class BatchWritingMechanism

  • All Implemented Interfaces:
    Serializable, Cloneable
    Direct Known Subclasses:
    DynamicSQLBatchWritingMechanism, ParameterizedSQLBatchWritingMechanism

    public abstract class BatchWritingMechanism
    extends Object
    implements Cloneable, Serializable
    INTERNAL: 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

    Since:
    OracleAS TopLink 10g (9.0.4)
    See Also:
    Serialized Form
    • Field Detail

      • databaseAccessor

        protected DatabaseAccessor databaseAccessor
        This member variable stores the reference to the DatabaseAccessor that is using this Mechanism to handle the batch writing
      • queryTimeoutCache

        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.
      • executionCount

        protected int executionCount
      • statementCount

        protected int statementCount
      • maxBatchSize

        protected int maxBatchSize
        Allow for the batch size to be set as many database have strict limits.
    • Constructor Detail

      • BatchWritingMechanism

        public BatchWritingMechanism()
    • Method Detail

      • getMaxBatchSize

        public int getMaxBatchSize()
      • setMaxBatchSize

        public void setMaxBatchSize​(int maxBatchSize)
      • cacheQueryTimeout

        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.
        Parameters:
        session -
        dbCall -
      • clearCacheQueryTimeout

        protected void clearCacheQueryTimeout()
        INTERNAL: Clear the cached timeout after the statement has been executed.
      • appendCall

        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
      • clear

        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.
      • executeBatchedStatements

        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
      • initialize

        public void initialize​(AbstractSession session)
        INTERNAL: Allow initialization with the session after login.