Try OpenEdge Now
skip to main content
Multi-tenancy Overview
Multi-tenancy and ABL : ABL Support : Coding for super-tenant access : Tenancy identification
 
Tenancy identification
Tenancy is identified by:
*A name that you assign when you configure the tenant in a multi-tenant database.
*A database-unique, integer ID that OpenEdge assigns when you first create the tenant. The default tenant ID is zero (0), all other regular-tenant IDs are positive integers, and all super-tenant IDs are negative integers.
A super tenant can return information about database connection tenancy using these ABL built-in functions:
*IS-DB-MULTI-TENANT function — Returns TRUE if a connected database is multi-tenant enabled.
*TENANT-NAME and TENANT-ID function — Returns the tenant identity associated with a current database connection identity.
*TENANT-NAME-TO-ID function — Returns the tenant ID, given the tenant name associated a current database connection identity.
*GET-EFFECTIVE-TENANT-NAME and GET-EFFECTIVE-TENANT-ID function — Returns the current effective tenant identity for a connected database.
Note, again, that the GET-EFFECTIVE-TENANT-* functions return the most recent effective tenancy for a database connection, where as the corresponding TENANT-* functions return the tenancy of the current database connection identity. The effective tenancy for a database connection is set only using the SET-EFFECTIVE-TENANT function, where as the connection identity can be set using any connection authentication operation. These two tenancies can be different, with the most recently set tenancy overriding the other for purposes of effective tenancy.
A super tenant can return information about the tenancy of a database record using these ABL built-in elements:
*IS-MULTI-TENANT attribute on a buffer handle — Returns TRUE if the current record referenced by the specified buffer handle is multi-tenant.
*BUFFER-TENANT-NAME and BUFFER-TENANT-ID function — Returns the tenant identity that owns the current record in the specified buffer.
*BUFFER-TENANT-NAME and BUFFER-TENANT-ID attribute on a buffer handle — Returns the tenant identity that owns the current record referenced by the specified buffer handle.