Mastering PowerBuilder

HomePrevious Lesson: Debug Service
Next Lesson: DataWindow Caching Service

Transaction Registration Service

When you are using more than one transaction object based on the n_tr transaction object, you can make use of "transaction registration service", to keep track of the transaction objects that are being used in the application. First, you need to turn on the service as shown below:
gnv_app.of_SetTrRegistration(TRUE)

Then register each transaction object as shown below:
gnv_app.inv_trregistration.of_Register(SQLCA)

The application manager destroys the transaction registration service when the application closes. You can ask the transaction registration service to commit or rollback all opened transactions, when the service is being destroyed, by calling of_SetAutoRollback() function. The following statement commits all opened transactions:
SQLCA.of_SetAutoRollback(TRUE)
HomePrevious Lesson: Debug Service
Next Lesson: DataWindow Caching Service