Canceltransaction, Close – Echelon OpenLNS User Manual

Page 887

Advertising
background image

OpenLNS Programmer's Reference

850

CancelTransaction

Summary

Cancels an active transaction.

When a transaction is canceled, either explicitly because of a

reset, all network and database updates made since the call

to the StartTransaction method are reversed.
Once a transaction has been committed, it can no longer be

cancelled.
If you use the CancelTransaction method to end a transaction

that was initiated as part of a new application program

download and the download has already started, the device

receiving the program download will be left in an

applicationless state. However, this is not true if the

transaction was canceled before the transaction actually

started the download process.
The CancelTransaction method may return an "update type

error" indicating that the cancel has successfully reversed the

modifications to the database, but has been unable to update

one or more application devices. This will be an error in the

NS error range, but will be without the

lcaErrRangeNsStart (1000) value. To compare the update

error types returned by the CancelTransaction method to the

constant error values used in other OpenLNS operations, you

will need to add the lcaErrRangeNsStart (1000) value to

the returned error value.
For example, consider a case where the CancelTransaction

method returns error 63. To compare the returned exception

to the constant error values for the

NS error range, you

would need to add lcaErrRangeNsStart (1000) to the

returned value. In this case, the returned error maps to the

lcaErrNsNothingToCancel exception.
Unlike most other methods, the CancelTransaction method

may be called in an OnSystemNssIdleSystem event callback,

which allows you to cancel the current method or property,

and the transaction explicitly or implicitly containing it.

Availability

Local, full, and lightweight clients.

Syntax

returnCode = systemObject.CancelTransaction

Element

Description

returnCode

An Integer value which is assigned

the return status code.

systemObject

The

System

object whose

transaction will be canceled.

Added to API

Prior to LNS Release 3.0.

Close

Summary

Closes the system, ends events, shuts down the NSS, and

detaches the NSI from the network (if not opened in

Advertising