Transact
Transact_Compound
(SWI &4FC0C)
This SWI which appears in the v0.2.1 release of the Transact engine allows a client application to submit multiple data manipulation requests (INSERT
, DELETE
or UPDATE
) in just one client call.
On entry
- R0 = External session ID as returned by
Transact_CreateSession
;
- R1 = Data file's external ID (
NULL
or pointer to the pathname of the file);
- R2 = Pointer to an array of cells.
A cell is a chunk of 11 words:
The first word of each cell specifies the kind of operation for the engine to perform:
Reason code |
Operation |
2 |
DELETE |
3 |
INSERT |
4 |
UPDATE |
-1 |
Marks the end of the array |
The ten words (r0-r9) which follow hold the registers R0-R9 which should be submitted to individual servicing SWIs.
Register r0 usual purpose is to hold the session ID which is already known in our context; so the client application does not have to put a meaningful value into it;
The application only has to populate the register slots the individual SWI needs.
On exit
- All registers preserved.
- In case an error occured, the application can determine which cell was the source by examining the r0 slot of each cell from the array beginning and halting when the r0 slot value is not 0.
Possible errors
- &812B00 Busy (not yet implemented in this release)
- &812B01 Unknown session
- + Every error code a Transact_Insert, Transact_Delete or Transact_Update SWI can return.
Additional note
One important point in the Transact_Compound
SWI is that it implements partial rollback that is, when an error occurs as part of the processing of a service in the cell, the engine lets the transaction return to its state as it was before the first service call specified in the cell array was submitted (that is pending writes submitted as part of the active transaction beforewards are kept).