Committing updates to the database
When a Pipeline object executes, it commits updates to the
destination table according to your specifications in the Data Pipeline
painter. You do not need to write any COMMIT statements
in your application’s scripts (unless you specified the
value None for the Pipeline object’s
Commit property).
Example
For instance, both of the Pipeline objects in the order entry
application (pipe_sales_extract1 and pipe_sales_extract2)
are defined in the Data Pipeline painter to commit all rows.
As a result, the Start function (or the Repair function)
will pipe every appropriate row and then issue a commit.
You might want instead to define a Pipeline object that periodically issues commits
as rows are being piped, such as after every 10 or 100 rows.
If the Cancel function is called
A related topic is what happens with committing if your application
calls the Cancel function to stop a pipeline
that is currently executing. In this case too, the Commit property
in the Data Pipeline painter determines what to do, as shown in Table 17-3.
If |
Then |
---|---|
All |
Rolls back every row that was piped by |
A particular number of rows (such as 1, 10, |
Commits every row that was piped up to |
This is the same commit/rollback behavior that occurs
when a pipeline reaches its Max Errors limit (which is also specified
in the Data Pipeline painter).
For more information on controlling commits
and rollbacks for a Pipeline object, see the PowerBuilder Users
Guide.