CoordinatorException class: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Created page with "The <var>CoordinatorException</var> exception class indicates that a two-phase commit coordinator has returned an error. The <var>NewGlobal (Transaction function)|NewGloba...")
 
Line 91: Line 91:
</td></tr></table>
</td></tr></table>


====CoordinatorExceptionReason enumeration====
<h4 id="reason">CoordinatorExceptionReason enumeration</h4>
A <var>CoordinatorExceptionReason</var> [[Enumerations|enumeration]] may have one of the following values:
A <var>CoordinatorExceptionReason</var> [[Enumerations|enumeration]] may have one of the following values:
<table class="thJustBold">
<table class="thJustBold">

Revision as of 05:26, 15 January 2020

The CoordinatorException exception class indicates that a two-phase commit coordinator has returned an error.

The NewGlobal function and SetGlobal of the Transaction system classes are method that can throw a CoordinatorException exception. For more information about catching a thrown exception, see Try and Catch.

The following example shows a Try and Catch of a CoordinatorException exception.

begin %xid is string len 64 %coex is object coordinatorException try %xid = %(transaction):NewGlobal("Silly example transaction") catch coordinatorException to %coex printText NewGlobal failed: printText {%coex:reason}: {%coex:description} stop end try ... end

Note: It is necessary to declare the exception object, but instantiating it is taken care of by the Transaction class NewGlobal method.

The CoordinatorException methods

The following are the available CoordinatorException class methods.

MethodDescription
DescriptionBrief description of the exception
NewCreate a new CoordinatorException object
ReasonEnumerated cause of the exception

The methods in the class are described in the subsections that follow. In addition:

Description property

Brief description of the exception (CoordinatorException class)

This ReadOnly property returns a string that describes the error.

Syntax

%string = coordinatorException:Description

Syntax terms

%string This describes the error.
coordinatorException A reference to an instance of a CoordinatorException object.

New constructor

Create a new CoordinatorException object (CoordinatorException class)

This Constructor generates an instance of a CoordinatorException exception. As shown below, the optional argument of the New method is a setting of the DaemonOutput property.

Syntax

%coordinatorException = [%(CoordinatorException):]New( Reason= coordinatorExceptionReason, - [Description= string])

Syntax terms

%coordinatorException A reference to an instance of a CoordinatorException object.
[%(CoordinatorException):] The class name in parentheses denotes a Constructor.
CoordinatorExceptionReason This optional, but name required, parameter specifies a CoordinatorExceptionReason value that indicates the error.
Description This optional, but name required, parameter specifies a string that describes the error.

Reason property

Enumerated cause of the exception (CoordinatorException class)

This ReadOnly property returns a CoordinatorExceptionReason enumeration value that indicates the error.

Syntax

%coordinatorExceptionReason = coordinatorException:Reason

Syntax terms

%soordinatorExceptionReason Enumeration value that indicates the error.
coordinatorException A reference to an instance of a CoordinatorException object.

CoordinatorExceptionReason enumeration

A CoordinatorExceptionReason enumeration may have one of the following values:

ConnectionLost The connection with the coordinator was lost after it was established. This could be indicative of a compatibility issue between Model 204 and the coordinator.
InsufficientVirtualStorage There was insufficient virtual storage to allocate the blocks needed to connect to the coordinator.
InvalidResponse an invalid response to a request was received from the coordinator. This could be indicative of a compatibility issue between Model 204 and the coordinator.
MaximumConnectionsExceeded The maximum authorized Janus or Janus Two-Phase Commit connections are in use.
NameLookupError The host name specified in an ADDCOORDINATOR could not be resolved because of a DNS error.
NameUnresolved The host name specified in an ADDCOORDINATOR could not be located via DNS.
NoneAvailable There are either no 2PC ports defined or the first started 2PC port has no coordinators added to it.
NoPortConnectionsAvailable The maximum connections specified for the 2PC port are all in use.
TlsHandshakeError The TLS handshake with the coordinator specified in an ADDCOORDINATOR failed.
Unreachable It was not possible to connect to the coordinator host/port specified in an ADDCOORDINATOR.