Tenancy identification
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
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-TENANTfunction—ReturnsTRUEif a connected database is multi-tenant enabled. -
TENANT-NAMEandTENANT-IDfunction—Returns the tenant identity associated with a current database connection identity. -
TENANT-NAME-TO-IDfunction—Returns the tenant ID, given the tenant name associated a current database connection identity. -
GET-EFFECTIVE-TENANT-NAMEandGET-EFFECTIVE-TENANT-IDfunction—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, whereas 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, whereas 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-TENANTattribute on a buffer handle—ReturnsTRUEif the current record referenced by the specified buffer handle is multi-tenant. -
BUFFER-TENANT-NAMEandBUFFER-TENANT-IDfunction—Returns the tenant identity that owns the current record in the specified buffer. -
BUFFER-TENANT-NAMEandBUFFER-TENANT-IDattribute on a buffer handle—Returns the tenant identity that owns the current record referenced by the specified buffer handle.