To use transaction processing, enter the following command at the R> Prompt or in a command file before you open a database:
SET TRANSACT ON
While you are working at the R> Prompt, if you want each command to be made permanent immediately and visible to network users, turn AUTOCOMMIT on:
SET AUTOCOMMIT ON
If you want to be able to process a transaction without permanently affecting your data until you accept the changes, turn AUTOCOMMIT off. Then, to accept a transaction and make the changes permanent, enter the COMMIT command after you have entered the transaction. Or, to reverse the transaction and undo the changes, enter the ROLLBACK command. Whenever you disconnect from a database in the middle of a transaction (AUTOCOMMIT is set off), the transaction is saved as though you had entered a COMMIT command.
If you have started a transaction when you set AUTOCOMMIT on, R:BASE commits the transaction and turns AUTOCOMMIT on. You cannot open a cursor while AUTOCOMMIT is set on, and you cannot set AUTOCOMMIT on while a cursor is open. AUTOCOMMIT and MDI cannot be set to on at the same time. If MDI forms and browse screens are to be used, then autocommit mode cannot be running. If autocommit mode is required, then forms and browse screens cannot be modeless.
Because transaction processing also works in multi-user mode, you can specify the maximum number of users who can have the same database open concurrently with transaction processing on by specifying a value for MAXTRANS. For example, to specify 20 users:
SET MAXTRANS 20
In transaction processing, if you change the value of a SET command whose value is normally stored with the database, the new value is effective only until you close the database. The new SET value is not stored with the database.
With transaction processing on, execution time for commands is determined by several factors, particularly the number of users accessing the same database and the types of commands being executed. Some commands take longer to execute than others, and the same command can take longer from one user to the next.
You cannot use the following commands with transaction processing ON because these commands create new database structures or start other modules:
Transaction Processing Topics:
Locking Table Access and Resource Waiting
Row Locks and Transaction Processing
Automatic Table and Database Locks
Displaying Transaction Processing Locks
Resource Waiting in Transaction Processing
Generate a Transaction Journal
Recovering from Transaction Processing Errors