isRefresh()

With the function isRefresh(), you can check whether the workFunction of a dpConnect() has been triggered by a redundancy switch or has been triggered when trying to establish a connection to a distributed system.

The workFunction is only triggered if the CTRL manager is connected to both event managers (see [all sections] connectToRedundantHosts).

The workFunction is called as follows:

dpConnect

without answer

dpConnect with answer

dpQueryConnectSingle/-All

without answer

dpQueryConnectSingle/-All with answer
First answer No Yes(1) No Yes
Hotlinks Yes Yes Yes Yes
System lost No Yes(3) Yes(2) Yes(2)
System connected No Yes(4) Yes(5) Yes(4)
Redundancy switch No Yes(4) Yes(5) Yes(4)

(1) isAnswer() returns TRUE (otherwise FALSE).

(2) getLastError() returns an errClass with getErrorCode() == 144 (system lost) and getErrorDpName() the system name. The dyn_dyn_anytype is empty.

(3) Only when the on _original.._invalid, _original.._bad, _original.._status, _online.._invalid, _online.._bad, _online.._status are queried, thegetLastError() returns an errClass with getErrorCode() == 144 and getErrorDpName() the system name. _invalid, _bad bits are TRUE, the invalid bits are set for _status, and _stime is the current time. All other values are dummy values (0, FALSE).

In all other cases the work function is not called.

(4) isRefresh() returns TRUE (otherwise FALSE).

(5) getLastError() returns an errorClass with getErrorCode() == 157 and getErrorDpName() the system name.

When executing dpQueryConnectSingle()/-All with remote all (a dpQueryConnectSingle or dpQueryConnectAll to all systems), only the first answer that is returned (generally the answer from the own system) is considered as an answer (first row). All other answers are considered as refresh (system comes or a redundancy switch). This means that the isAnswer() returns TRUE only the first time (and isRefresh() returns FALSE). Afterwards the isAnswer() returns FALSE (and isRefresh() TRUE).

Synopsis

bool isRefresh();

Return value

Bool. TRUE (1) if the WorkFunction of a dpConnect() has been triggered by a redundancy switch or was triggered when trying to establish a connection to a redundant system. FALSE when not.

Error

Description

With the function isRefresh(), you can check whether the workFunction of a dpConnect() has been triggered by a redundancy switch or has been triggered when trying to establish a connection to a redundant system.
Anmerkung: This function will also return "TRUE" when a User-change (e.g.: with the function setUserId()) occurs.

Assignment

Administration of managers.

Availability

CTRL