com.tibco.datagrid

## Interface BatchResult

- All Superinterfaces:
    java.lang.AutoCloseable

      public interface BatchResult
      extends java.lang.AutoCloseable

  A BatchResult object is used to get the results or error from a batched operation

  The BatchResult object is NOT thread-safe. Do not invoke multiple operations on a single BatchResult using more than one thread. Behavior is not defined if this happens.

  To create a BatchResult object, call `Session.getRows`, `Session.putRows`, `Session.deleteRows`, or `Session.updateRows`.

  A program that creates a BatchResult should explicitly call `BatchResult.close` to reclaim its resources.

  Since Version 4.10: Whenever a `BatchResult` that did not have its `BatchResult.close` method called is garbage collected, the native resources will be reclaimed automatically. This behavior is controlled by the com.tibco.tibdg.autoclose System Property. If the property is not set or set to "cleanup" (the default), the native resources will be reclaimed as if the `BatchResult.close` method had been called. If the System Property is set to "warn", a warning will be printed to stderr instead of doing the cleanup. If the property is set to "inactive", this feature will not be activated.

  This interface is implemented internally. Applications do not implement this interface.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `allSucceeded()` Find whether or not every operation in the batch succeeded If the batched operation was a GET, and this function returned true `BatchResult.getRow()` can be called to retrieve the result row
    `void` | `close()` Destroy a BatchResult.
    `Row` | `getRow(int i)` Get a Row result from a batched GET
    `int` | `getRowUpdateCount(int i)` Get the count of rows updated for the supplied index in the BatchResult.
    `int` | `getSize()` Get the count of successful operations

- - ### Method Detail

    - #### allSucceeded

          boolean allSucceeded()
                        throws DataGridException

      Find whether or not every operation in the batch succeeded If the batched operation was a GET, and this function returned true `BatchResult.getRow()` can be called to retrieve the result row
      Returns:
        boolean
      Throws:
        `DataGridException` - in case of failures

    - #### getRow

          Row getRow(int i)
              throws DataGridException

      Get a Row result from a batched GET

      This function is valid only for GET batches that have the status TIB_OK. The row returned for int i corresponds to the request in the input row array at rows[i]

      Parameters:
        `i` - the index of the row to retrieve
      Returns:
        `Row`
      Throws:
        `DataGridException` - in case of failures

    - #### getSize

          int getSize()
               throws DataGridException

      Get the count of successful operations

      Note: For fully successful batches, this should be the size of the input row array

      Returns:
        int
      Throws:
        `DataGridException` - in case of failures

    - #### getRowUpdateCount

          int getRowUpdateCount(int i)
                         throws DataGridException

      Get the count of rows updated for the supplied index in the BatchResult.

      Note: This is only valid for UPDATE batches. You must call allSucceeded prior to this to ensure the batch succeeded.

      Parameters:
        `i` - the index of the row to check
      Returns:
        int
      Throws:
        `DataGridException` - in case of failures

    - #### close

          void close()
              throws DataGridException

      Destroy a BatchResult.
      Specified by:
        `close` in interface `java.lang.AutoCloseable`
      Throws:
        `DataGridException` - in case of failures