QMTxn()

QMTxn()

Top  Previous  Next

 

The QMTxn() function starts, commits or aborts a transaction on the server.

 

The function takes a single argument, Mode, as the action to be performed. This may be:

1Start a transaction. Equivalent to use of the QMBasic TRANSACTION START statement.
2Commit a durable transaction. Equivalent to use of the QMBasic TRANSACTION COMMIT statement.
3Abort a transaction. Equivalent to use of the QMBasic TRANSACTION ABORT statement.
4Commit a non-durable transaction. Equivalent to use of the QMBasic TRANSACTION COMMIT statement in a program compiled with the NON.DURABLE.TXN setting of the $MODE compiler directive.

 

The example program fragments below read two records, apply an update such as transferring funds from one client to the other, and then write both records. By using a transaction, the two updates are applied together. A real program would include error handling.

 

 

hmtoggle_plus1C

 

hmtoggle_plus1VB.Net

 

hmtoggle_plus1QMBasic Class Module

 

hmtoggle_plus1Java

 

hmtoggle_plus1Python