The PowerBuilder TransactionServer class supports the following methods:
CreateInstance – (for NVO intercomponent calls) use the two-argument form, and specify the full JNDI name of the target component:
TransactionServer ts getContextService("TransactionServer", ts) // generate and use proxies pbtest_MyComp comp ts.createInstance(comp, "pbtest/MyComp") // call methods on comp
DisableCommit – prevents the current transaction from being committed, because the component’s work has not been completed. The instance remains active after the current method returns.
EnableCommit – the component should not be deactivated after the current method invocation; allows the current transaction to be committed if the component instance is deactivated.
IsInTransaction – determines whether the current method is running in a transaction.
IsTransactionAborted – determines whether the current transaction has been aborted.
SetAbort – specifies that the component cannot complete its work for the current transaction and that the transaction should be rolled back. The component instance is deactivated when the method returns.
SetComplete – indicates that the component has completed its work in the current transaction and that, as far as it is concerned, the transaction can be committed and the component instance can be deactivated.
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.