Interface Batcher

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void close()
      Flush the batcher and close it.
      void flush()
      Flush the batcher and send all remaining items in memory to the database.
      int getBatchSize()
      Get the current batch size of the batcher.
      boolean isClosed()
      Check if the batcher has been closed or not.
      void setBatchSize​(int batchSize)
      Sets the batch size.
    • Method Detail

      • getBatchSize

        int getBatchSize()
        Get the current batch size of the batcher. The batch size indicates how many individual items a batcher is caching in memory before they are automatically flushed to the database.
        Returns:
        The current batch size, or 0 if automatic flushing is turned of
      • setBatchSize

        void setBatchSize​(int batchSize)
        Sets the batch size. The batch size indicates how many individual items a batcher is caching in memory before they are automatically flushed to the database.
        Parameters:
        batchSize - Size of the batch, or 0 to disable automatic flushing
      • isClosed

        boolean isClosed()
        Check if the batcher has been closed or not. A closed batcher will not accept any more data for insert, update or delete. Note! A batcher that uses an underlying DbControl to connect to the database will automatically be closed when the DbControl is closed.
        Returns:
        TRUE if the batcher is closed, FALSE otherwise
        See Also:
        close()
      • flush

        void flush()
            throws BaseException
        Flush the batcher and send all remaining items in memory to the database.
        Throws:
        BaseException - If there is an error
        See Also:
        close()
      • close

        void close()
            throws BaseException
        Flush the batcher and close it. A closed batcher will not accept any more data for insert, update or delete. Note! A batcher that uses an underlying DbControl to connect to the database will automatically be closed when the DbControl is closed.
        Specified by:
        close in interface AutoCloseable
        Throws:
        BaseException - If there is an error
        See Also:
        isClosed(), flush()