Interface IDfBatchManager


public interface IDfBatchManager
This interface provides the functionality for insert batching. Opening a batch implicitly starts a new transaction. During batching, the server uses the functions provided by the database to optimize the insert operation.

Batch size (the number of objects) is a hint to the server to allocate memory for caching the data. When the cache reaches its limit, the server will flush the data into database.

By default, queries issued against a batch object type during the batch will cause the server to flush the cached object. By setting the flushBatchQuery flag to false, the client can tell the server not to flush the data if the query is not affected by the data created inside the batch. The flushBatchQuery flag is used as default by queries inside the transaction but any query can override this flag by using the method IDfQuery.setFlushBatchQuery.

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final int
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Abort the batch operation and roll back the batch transaction.
    void
    Flush the batch, commit the transaction, and close the batch.
    void
    Flush the batch data into the repository and commit the transaction for the batch.
    void
    Flush the batch data into the repository.
    Get the failed groups in the transaction.
    Get all groups in the current transaction
    int
    Get the setting for the batch size.
    boolean
    Check to see if there is an active batch.
    boolean
    Get the Boolean value for flushBatchOnQuery.
    boolean
    Get the Boolean setting for oneAuditPerBatch.
    boolean
    Get the Boolean setting for oneEventPerBatch.
    void
    Start a new group in the current batch.
    void
    This openBatch() method opens an insert batch, using default values.
    void
    openBatch(int size, boolean flushBatchOnQuery, boolean oneAuditPerBatch, boolean oneEventPerBatch, Properties options)
    Opens an insert batch.
    void
    openBatchGroup(int size, boolean flushBatchOnQuery, boolean oneAuditPerBatch, boolean oneEventPerBatch, String ignoreInsertError)
    Opens an insert batch that uses groups.
  • Field Details

  • Method Details

    • openBatch

      void openBatch() throws DfException
      This openBatch() method opens an insert batch, using default values. The batch size (dfc.batchmanager.max_batch_size) is set in the dfc.properties file. If it is not set there, the value defaults to 20. The value should be between 20 - 1000. The value of flushBatchOnQuery is set to true, and the values of oneAuditPerBatch and oneEventPerBatch are set to false.

      Throws:
      DfException - if operation fails
    • openBatch

      void openBatch(int size, boolean flushBatchOnQuery, boolean oneAuditPerBatch, boolean oneEventPerBatch, Properties options) throws DfException
      Opens an insert batch.
      Parameters:
      size - Size of the batch
      flushBatchOnQuery - A flag passed to the server by queries inside the batch if not overridden by the query
      oneAuditPerBatch - Generate one audit trail per batch size; the server only honors this flag if the caller has Audit Config privilege.
      oneEventPerBatch - Combines object creation events into a dm_batch_flush event to reduce the number of events generated during object creation.
      options - Database-specific options
      Throws:
      DfException - Thrown if the operation fails //@see #com.documentum.fc.client.IDfQuery.setFlushBatchQuery
    • openBatchGroup

      void openBatchGroup(int size, boolean flushBatchOnQuery, boolean oneAuditPerBatch, boolean oneEventPerBatch, String ignoreInsertError) throws DfException
      Opens an insert batch that uses groups.
      Parameters:
      size - Size of the batch
      flushBatchOnQuery - A flag passed to the server by queries inside the batch if not overridden by the query
      oneAuditPerBatch - Generate one audit trail per batch size; the server only honors this flag if the caller has Audit Config privilege.
      oneEventPerBatch - Combines object creation events into a dm_batch_flush event to reduce the number of events generated during object creation.
      ignoreInsertError - is a comma separated list of registered tables. Insert errors from these tables will be ignored, but errors from tables not in the list will roll back the batch transaction.
      Throws:
      DfException - Thrown if the operation fails //@see #com.documentum.fc.client.IDfQuery.setFlushBatchQuery
    • flushBatch

      void flushBatch() throws DfException
      Flush the batch data into the repository.
      Throws:
      DfException - if operation fails
    • commitBatch

      void commitBatch() throws DfException
      Flush the batch data into the repository and commit the transaction for the batch. A new implicit transaction is opened for subsequent batch insert.
      Throws:
      DfException - if operation fails
    • abortBatch

      void abortBatch() throws DfException
      Abort the batch operation and roll back the batch transaction. None of the batch data is saved. The batch is closed.
      Throws:
      DfException - if operation fails
    • closeBatch

      void closeBatch() throws DfException
      Flush the batch, commit the transaction, and close the batch.
      Throws:
      DfException - if operation fails.
    • isOneAuditPerBatch

      boolean isOneAuditPerBatch()
      Get the Boolean setting for oneAuditPerBatch.
      Returns:
      the flag indicating if one audit trail is generated per batch size
    • isOneEventPerBatch

      boolean isOneEventPerBatch()
      Get the Boolean setting for oneEventPerBatch.
      Returns:
      the flag indicates if one audit trail is generated per batch size
    • isBatchActive

      boolean isBatchActive()
      Check to see if there is an active batch.
      Returns:
      true if there is an active batch
    • isFlushBatchOnQuery

      boolean isFlushBatchOnQuery()
      Get the Boolean value for flushBatchOnQuery.
      Returns:
      the flushBatchOnQuery
    • newGroup

      void newGroup() throws DfException
      Start a new group in the current batch.
      Throws:
      DfException
    • getGroups

      List<IDfBatchGroup> getGroups()
      Get all groups in the current transaction
      Returns:
      groups
    • getFailedGroups

      List<IDfBatchGroup> getFailedGroups()
      Get the failed groups in the transaction. A commitBatch call will generate failed groups if there is any error. Call this method after commitBatch returns an error for the commited batch. Any subsequent call to create a new object and insert a new row will clear the failed groups for the previous commited batch.
      Returns:
      failed groups
    • getMaxBatchSize

      int getMaxBatchSize()
      Get the setting for the batch size.
      Returns:
      the size of batch