Syntax 2: For TransactionServer objects – PB Docs 2017

Syntax 2: For TransactionServer objects

Description

Declares that the transaction in which a component is
participating should be committed and the component instance should be
deactivated.

Applies to

TransactionServer objects

Syntax

Argument

Description

transactionserver

Reference to the TransactionServer service
instance

Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs.

Usage

The SetComplete function corresponds to the
completeWork transaction primitive in EAServer.

Any component that participates in a transaction can roll back the
transaction by calling the rollbackWork primitive. Only the action of
the root component (the component instance that began the transaction)
determines when EAServer commits the transaction.

The transaction is committed if either of the following
occurs:

  • The root component returns with a state of completeWork and no
    participating component has set a state of disallowCommit.

  • The root component is deactivated due to an explicit destroy
    from the client and no participating component has set a state of
    disallowCommit. (A client disconnect that is not preceded by an
    explicit destroy request always causes a rollback.)

You can use the transaction state primitives in any component; the
component does not have to be declared transactional. Calling
completeWork or rollbackWork from methods causes early
deactivation.

Examples

The following example shows the use of SetComplete in a component
method that performs database updates:

See also

DisableCommit

EnableCommit

IsInTransaction
(obsolete)

IsTransactionAborted
(obsolete)

Lookup (obsolete)

SetAbort

Which


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x