Use batch mode [extension]
- Last Updated: January 16, 2024
- 1 minute read
- OpenEdge
- Version 12.8
- Documentation
Batch mode allows an Open Client to send several updates to
the application server in one transaction. Depending on your application requirements, this
might be a better update strategy than generating a transaction for each update method:
- If your application requires user feedback for each update method applied, you generally
must complete a transaction for each update method and
Batchmode is not appropriate. - If your application requires that a group of updates be applied and
succeed together, you must group the updates into a single large transaction. You can do
this by using an automatic transaction or by using
Batchmode. - If your application has the option of applying several updates individually or as a group,
you can generally increase performance dramatically by grouping the updates into a single
large transaction using
Batchmode. - If your SDOResultSet is in
Statelessmode, you can apply modifications only underBatchmode.
The following table lists the SDOResultSet methods that support Batch
mode.
| Method | Description |
|---|---|
void cancelBatch() [Extension]
|
Undoes |
void sendBatch() [Extension]
|
Sends the current batch to the application server. |
void sendBatchAndReOpen() [Extension]
|
Sends the current batch to the application server,
then reopens the ResultSet. In Stateless mode, this
method is more efficient than separately calling sendBatch() and reOpenQuery(). For more
information, see Visibility of updates. |
void startBatch() [Extension]
|
Starts a batch session. All the modifications (column
updates, deletions and insertions) are maintained locally. Calling this method if you
have already called it and have not called sendBatch() or cancelBatch() throws an
Exception. |
boolean inBatch() [Extension]
|
Returns true if the
SDOResultSet object is in Batch mode (that is, you
have called startBatch() and have not yet called
sendBatch() or sendBatchandReopen()).Note: A row that is
updated or deleted in Batch mode, and has not yet
been sent to the application server (using sendBatch()), cannot be refreshed using refreshRow(). Also, to save your changes locally in batch mode, you must
still call the row update methods (for example, insertRow() or updateRow()) even
though, in this mode, your changes are not sent to the application
server. |