Class T_BizObj (unit BO) |
TDataModule
Constructors |
Functions |
Properties |
Events |
Variables |
Constructors |
Functions |
for the sake of this example beginning a transaction is updating the "InUseBy" field and "InUseAt" fields in the main table. If the lock has been held longer than 15 miniutes, the lock will be ignored. If someone else has locked this record, a message box telling when the record was locked and by whom will be shown
When changes have been made, commit trans will call the applyupdate methods of any tables and then update the lock fields in the main table. this method should be overridden with inherited called at the end of the procedure because the _BizObj class cannot possibly know how to apply all updates for any tables that need to have them applied.
Rollback trans will blow away any cache changes that have been made and release release the lock on the record. This method should be overridden in a subclassed module because the _BizObj class cannot possibly know how to blow away all changes.
the new before insert will check to see if we are in a transaction and if not it will call begin transaction it will then call the before insert that was specified for the table
MainTable.post;
the set main table is responsible for hooking the before edit event of the main table. If the main table is changed the old ones have to be restored.
Properties |
the InTransaction property is a read only property to publish the fInTrans variable which states that the bisiness object is in a transaction or not.
this property represents the main table that the locks will be held in. This has to be a table object, and it is recommended that this object be the one that editing is done in. If this is not filled in, when the commit, rollback or begin transaction methods fire, an error will happen.
Events |
Variables |