Example: Workload assignment when workload attributes have single values
The example in this topic shows how the data server performs workload assignment. In this example, only one value is specified for each workload connection attribute.
Evaluation order | Workload name | ADDRESS | APPLNAME | SYSTEM
_USER |
SESSION
_USER |
SESSION
_USER GROUP |
SESSION
_USER ROLE |
CURRENT
CLIENT _USERID |
CURRENT
CLIENT _APPLNAME |
CURRENT
CLIENT _WRKSTNNAME |
CURRENT
CLIENT _ACCTNG |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | REPORTS | AppA | |||||||||
2 | INVENTORY REPORT | AppB | LYNN | ACCOUNTING | TELEMKTR | ||||||
3 | SALES REPORT | AppC | KATE | KATE | SALESREP | ||||||
4 | AUDIT REPORT | AppB | ACCOUNTING | FINANALYST | |||||||
5 | EXPENSE REPORT | AppA | TIM | EXPENSE APPROVER | |||||||
6 | AUDIT RESULT | LYNN | LYNN | Audit Group |
ADDRESS | APPLNAME | SYSTEM
_USER |
SESSION
_USER |
SESSION
_USER GROUP |
SESSION
_USER ROLE |
CURRENT
CLIENT _USERID |
CURRENT
CLIENT _APPLNAME |
CURRENT
CLIENT _WRKSTNNAME |
CURRENT
CLIENT _ACCTNG |
---|---|---|---|---|---|---|---|---|---|
9.26.53.111 | AppA | TIM | TIM | FINANCE | FINANALYST, EXPENSE APPROVER | NULL | NULL | NULL | Business account |
When the first unit of work is submitted, the data server checks each workload in the catalog, starting with the first workload in the list, and processes the workloads in ascending order until it finds a workload with matching attributes. When a matching workload is found, the unit of work runs under an occurrence of that workload. When determining which workload to assign the connection to, the data server compares the connection attributes in deterministic order.
Evaluation order | Workload name | ADDRESS | APPLNAME | SYSTEM
_USER |
SESSION
_USER |
SESSION
_USER GROUP |
SESSION
_USER ROLE |
CURRENT
CLIENT _USERID |
CURRENT
CLIENT _APPLNAME |
CURRENT
CLIENT _WRKSTNNAME |
CURRENT
CLIENT _ACCTNG |
---|---|---|---|---|---|---|---|---|---|---|---|
1 | REPORTS | AppA |
- APPLNAME. The value of APPLNAME,
AppA
, for the database connection matches the value of APPLNAME for the REPORTS workload. - SYSTEM_USER, which is not set in the workload definition. Any value (including a null value) is considered a match.
- SESSION_USER, which is not set in the workload definition. Any value is considered a match.
- SESSION_USER GROUP, which is not set in the workload definition. Any value is considered a match.
- SESSION_USER ROLE, which is not set in the workload definition. Any value is considered a match.
- CURRENT CLIENT_USERID, which is not set in the workload definition. Any value is considered a match.
- CURRENT CLIENT_APPLNAME, which is not set in the workload definition. Any value is considered a match.
- CURRENT CLIENT_WRKSTNNAME, which is not set in the workload definition. Any value is considered a match.
- CURRENT CLIENT_ACCTNG, which is not set in the workload definition. Any value is considered a match.
In this situation, because of the explicit and implicit matches between the connection attributes of the REPORTS workload and the information passed on the connection, the data server selects the REPORTS workload as a potential match. After selecting a workload, the data server then checks whether the session user has the USAGE privilege on the workload. Assuming that the session user TIM has the USAGE privilege on the REPORTS workload, that workload is used for the connection. If, however, TIM does not possess the USAGE privilege on the REPORTS workload, the data server continues by checking the INVENTORYREPORT workload for a match.
ALTER WORKLOAD EXPENSEREPORT POSITION AT 1
ALTER WORKLOAD EXPENSEREPORT BEFORE REPORTS
Evaluation order | Workload name | APPLNAME | SYSTEM
_USER |
SESSION
_USER |
SESSION
_USER GROUP |
SESSION
_USER ROLE |
CURRENT
CLIENT _USERID |
CURRENT
CLIENT _APPLNAME |
CURRENT
CLIENT _WRKSTNNAME |
CURRENT
CLIENT _ACCTNG |
---|---|---|---|---|---|---|---|---|---|---|
1 | EXPENSE REPORT | AppA | TIM | EXPENSE APPROVER | ||||||
2 | REPORTS | AppA | ||||||||
3 | INVENTORY REPORT | AppB | LYNN | ACCOUNTING | TELEMKTR | |||||
4 | SALES REPORT | AppC | KATE | KATE | SALESREP | |||||
5 | AUDIT REPORT | AppB | ACCOUNTING | FINANALYST | ||||||
6 | AUDIT RESULT | LYNN | LYNN | Audit Group |
GRANT USAGE ON WORKLOAD EXPENSEREPORT TO USER TIM
COMMIT
At the beginning of the next unit of work, workload reassignment occurs, and the data server assigns the connection from TIM to the EXPENSEREPORT workload. In addition, new units of work submitted by other connections that have the same attributes are also associated with the EXPENSEREPORT workload.