public interface BatchResult
extends java.lang.AutoCloseable
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.
| 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
|
boolean allSucceeded()
throws DataGridException
BatchResult.getRow()
can be called to retrieve the result rowDataGridException - in case of failuresRow getRow(int i) throws DataGridException
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]
i - the index of the row to retrieveRowDataGridException - in case of failuresint getSize()
throws DataGridException
Note: For fully successful batches, this should be the size of the input row array
DataGridException - in case of failuresint getRowUpdateCount(int i)
throws DataGridException
Note: This is only valid for UPDATE batches. You must call allSucceeded prior to this to ensure the batch succeeded.
i - the index of the row to checkDataGridException - in case of failuresvoid close()
throws DataGridException
close in interface java.lang.AutoCloseableDataGridException - in case of failures