| Business Objects and Data Sources > Data Sources > Grouping Changes in Batches |
Grouping Changes in Batches |
INDEX
PREVIOUS
NEXT
|
You can make changes to the contents of a data source or to business objects by grouping them into batches. In this way, changes are handled more efficiently and provide improved performance. You can batch additions and removals of objects, as well as changes to the business objects themselves, such as changes in the containment structure, link extremities or attribute values.
IlpAbstractDataSource datasource = ... ... datasource.startBatch(); // add/remove objects // update attribute values, change containment, change link extremities ... datasource.endBatch();
Data source changes that are grouped in a batch are delayed until the call to endBatch.
Batches can be nested. In this case, changes are delayed until the most enclosing call to endBatch().
datasource.startBatch();
datasource.startBatch();
// first batch
...
datasource.endBatch();
datasource.startBatch();
// second batch
...
datasource.endBatch();
datasource.endBatch();
Data source changes in XML streams can be grouped in batches using the element <batch> as illustrated in the following sample:
<cplData>
<batch>
<addObject>
<!-- ... -->
</addObject>
<updateObject>
<!-- ... -->
</updateObject>
<removeObject>
<!-- ... -->
</removeObject>
</batch>
</cplData>
Batches can also be nested in data source XML streams by nesting <batch> elements. In this case, changes are delayed until the most enclosing </batch>.
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. All rights reserved. Legal terms. | PREVIOUS NEXT |