Loading...
 

SetLayer

SetLayer

SetLayer

Stack
Stack Description
Stack(In) n
Stack(Out) -

Sets the nth layer. Data in a layer!= n cannot be accessed via the object manager. The following example shows the connection between layer, domain and bitpattern for Inheritance.

A database can be divided (even physically via different files) into several layers which in extreme cases are completely independent of each other.
However, there are classes that are located in one layer but can be accessed from all layers (clients, users, ...).

Attention: If the layer is only changed for one process step/subprocedure, the developer should manually reset the layer at the end of the procedure (this is not done automatically), so that calling this procedure does not cause any undesired side effects. To ensure that the layer is reset correctly in case of an error, a BeginTXN should be placed in front of SetLayer so that the layer is also reset when the transaction is rolled back in case of an error.

At login SetLayer is used as follows:

// Set database layer
cyberEnterprise Copy(dataBaseLayer) Dup
ifnot
{
  Drop // Drop the entry from the stack

  T("Mandant in Datenbank nicht definiert oder gesperrt", "Client not defined in database or secured")
  Attention(AbortTXN) cancel
}
// Set database layer
SetLayer

 

// ###################################################

// A simpler example:

2 SetLayer // Sets the second database layer as active!