iTP Active Transaction Pages (iTP ATP) Programmer's Guide

ATP Objects, Properties, and Methods
iTP Active Transaction Pages (iTP ATP) Programmer’s Guide522292-002
4-39
NonStop TM/MP (TMF) Object
NonStop TM/MP (TMF) Object
This object enables you to develop scripts that implement transaction protection. For a
discussion and example of using this object, see Using Pathway TS/MP Servers from
JavaScript on page 3-8.
atp.transaction Object
The transaction object represents a TMF transaction. The TMF transaction starts when
the application refers to the atp.transaction object when invoking the send()
method of an atp.buffer object, or the execute() or next() methods of the
atp.SQL object. Internally the transaction begins, and is then suspended until it
receives a commit( ) or rollback( ).
Constructor
new atp.transaction()
Instantiate this object whenever a new TMF transaction is needed.
Properties
error (read-only)
This property is a NonStop Kernel error code and is set both by implicit and explicit
method calls. The implicit method calls to begin a TMF transaction occur when the
application first refers to an atp.transaction object. A zero (0) value indicates
that no error occurred.
status (read-only)
This property is the transaction status (for example, committed or hung), expressed
as text. See the NonStop TM/MP manual set for a list and descriptions of defined
values.
transid (read-only)
This property is the TMF transid expressed as text.
Methods
commit()
This method commits the TMF transaction represented by the
atp.transaction object. Check the error property for error conditions.
rollback()
This method rolls back the TMF transaction represented by the
atp.transaction object. Check the error property for error conditions.