Try OpenEdge Now
skip to main content
Developing WebSpeed Applications
Controlling Database Transactions : What is a database transaction? : DB transactions in code
 

DB transactions in code

The terms physical transaction and commit unit refer to the same concept as the WebSpeed database transaction. For example, in the previous scenario where you are adding customer records, each customer record you add is a database transaction. In the following, each order-line you create is a database transaction:
Figure 15. Database transaction definition
The database transaction is undone (or backed out) if:
*The system goes down (or crashes).
*The user presses the STOP button in a browser.
*A state-aware Web object times out.
In all of these cases, WebSpeed undoes all work it performed since the start of the database transaction, as illustrated in the following figure:
Figure 16. Database transaction undo processing
So far, you have seen how a database transaction can be useful in a situation that involves only a single table. Database Transactions take on additional importance when you make database changes in multiple tables or records.