Kbase 20089: ADM2 - How to Customize Transactions Between SDOs Using the AUTOCOMMIT Property and SubmitCommit Pro
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/10/2008 |
|
Status: Verified
GOAL:
How Progress SmartDataObjects (SDO) work with transactions and how the AUTOCOMMIT property works in conjunction with the commitSubmit procedure and RowObjUpd temp-table
FACT(s) (Environment):
Progress 9.x
ADM2
FIX:
It is possible to customize transactions between SDOs with the AUTOCOMMIT property and SubmitCommit procedure. The SDOs can reside in different windows. This is especially useful if you want to use your own logic (button, menu option, etc.) to replace the CommitPanel.
AUTOCOMMIT is a property of the SDO. The default value of Autocommit is TRUE. When AUTOCOMMIT is TRUE and you use UpdatePanel, the record is saved directly to the database when you press the "save" button.
If the value of Autocommit is FALSE, the record is saved in the RowObjUpd temp-table. Only the records and fields that have been modified in the current transaction are saved.
This FALSE property is set using the following function:
DYNAMIC-FUNCTION('setAutoCommit':U IN <SDO-handle>, INPUT FALSE).
The procedures that interact with the AUTOCOMMIT property are submitCommit and commitTransaction.
The submitCommit procedure:
- Gets the value of the Autocommit property.
- If this value is FALSE, the record is saved in the RowObjUpd temp-table.
- If the value is TRUE, the commitTransaction procedure is executed.
The commitTransaction procedure:
- Checks that there are no unsaved changes.
- Initiates the transaction process by running the commit function.
An example of this scenario is the commitPanel. When you use the commitPanel, the AUTOCOMMIT property is set to FALSE. When you press the commit button, the commitTransaction procedure is executed.