Managing transactions

The PowerBuilder TransactionServer class supports the following methods:

UseContextObject parameter

If you plan to use the TransactionServer context object to work with EAServer transaction service primitives, you may want to set the UseContextObject DBParm parameter for your connection to yes. If a component supports transactions, setting UseContextObject to yes tells PowerBuilder that you will be using the TransactionServer object methods, rather than COMMIT and ROLLBACK, to indicate that the component has completed its work for the current transaction. If your scripts call COMMIT and ROLLBACK, they will generate database errors in the SQLCA.SqlErrText string, which can help you refine your code during development.

If you want to continue to call COMMIT and ROLLBACK on a PowerBuilder Transaction object, set UseContextObject to no. For components that use an EAServer data source, this causes COMMIT and ROLLBACK statements to behave like the TransactionServer object’s SetComplete and SetAbort functions, which call the EAServer transaction service’s CommitWork and AbortWork methods.This is the default.

For components that do not support transactions, the UseContextObject setting is ignored, and PowerBuilder drivers handle COMMIT and ROLLBACK statements.