Transaction Number Table
When a transaction document is saved by STEPforward, it is assigned the next available transaction number in SF_TXDetail table (SF_TX) based on the contents of table SF_TXNumber. Each row in the transaction document is also assigned a unique row id number (SF_ID); this number is too supplied by SF_TXNumber table that has the following structure:
Column | Generalized data type | Use |
TXCounter | INT | Next available TX number |
LineCounter | INT | Highest used row id |
SF_TimeStamp | SMALLINT | Version of the row (incremented with each update) |
Notes:
The table contains only one row. When a new transaction document is saved, its transaction number plus 1 is stored in TXCounter column, thus becoming the next available transaction number. LineCounter column stores the highest used SF_ID number of the transaction record (typically the last record in the document).
SF_TimeStamp is used for the version control of the concurrent access to the table in a multi-user environment. When the transaction number needs to be acquired from the table, STEPforward loads the TXCounter, LineCounter and SF_TimeStamp values in its volatile memory. Immediately after loading the table, STEPforward attempts to increment the counters and the timestamp in the table using the loaded value of SF_TimeStamp as the search criterion. If the search fails (which can happen only if some other user updated the row in the narrow time slot between loading and updating the table), STEPforward repeats the attempt to update the table up to 3 times, before giving up and asking the user to try saving the document at a later time.