01.06.2013 Views

OpenEdge Getting Started: Multi-tenancy Overview - Product ...

OpenEdge Getting Started: Multi-tenancy Overview - Product ...

OpenEdge Getting Started: Multi-tenancy Overview - Product ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Super-tenant data updates<br />

ABL Support<br />

ABL allows a super tenant to create (with can-create access) and update (with<br />

can-write or can-delete access, as appropriate) database records for specified tenants<br />

using the following elements:<br />

• CREATE statement and BUFFER-CREATE( ) method on a buffer handle — For a<br />

multi-tenant table, these ABL elements provide an option for a super tenant to<br />

create a database record for a specified tenant, regardless of the effective<br />

<strong>tenancy</strong>. Without this option, these ABL elements create database records owned<br />

by the effective tenant.<br />

• All record update statements, such as ASSIGN, SET, UPDATE, DELETE, etc. —<br />

Regardless of the current effective tenant, ABL remembers the <strong>tenancy</strong> of all<br />

records created for a multi-tenant database as well as the records retrieved from<br />

a multi-tenant database. When a super tenant updates database records created<br />

for multiple tenants or queried for multiple tenants, ABL ensures that all these<br />

record instances are written to or deleted from the table instances owned by the<br />

corresponding tenants.<br />

Tenancy identification<br />

Tenancy is identified by:<br />

• A name that you assign when you configure the tenant in a multi-tenant database.<br />

• A database-unique, integer ID that <strong>OpenEdge</strong> assigns when you first create the<br />

tenant. The default tenant ID is zero (0), all other regular-tenant IDs are positive<br />

integers, and all super-tenant IDs are negative integers.<br />

A super tenant can return information about database connection <strong>tenancy</strong> using these<br />

ABL built-in functions:<br />

• IS-DB-MULTI-TENANT function — Returns TRUE if a connected database is<br />

multi-tenant enabled.<br />

• TENANT-NAME and TENANT-ID function — Returns the tenant identity associated<br />

with a current database connection identity.<br />

• TENANT-NAME-TO-ID function — Returns the tenant ID, given the tenant name<br />

associated a current database connection identity.<br />

• GET-EFFECTIVE-TENANT-NAME and GET-EFFECTIVE-TENANT-ID function —<br />

Returns the current effective tenant identity for a connected database.<br />

Note, again, that the GET-EFFECTIVE-TENANT-* functions return the most recent<br />

effective <strong>tenancy</strong> for a database connection, where as the corresponding TENANT-*<br />

functions return the <strong>tenancy</strong> of the current database connection identity. The<br />

effective <strong>tenancy</strong> for a database connection is set only using the<br />

SET-EFFECTIVE-TENANT function, where as the connection identity can be set using<br />

any connection authentication operation. These two tenancies can be different, with the<br />

most recently set <strong>tenancy</strong> overriding the other for purposes of effective <strong>tenancy</strong>.<br />

<strong>OpenEdge</strong> <strong>Getting</strong> <strong>Started</strong>: <strong>Multi</strong>-<strong>tenancy</strong> <strong>Overview</strong> 57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!