Example: Workload assignment when workload attributes have multiple values

The example in this topic shows how the data server performs workload assignment. In this example, some of the workload definitions permit more than one value for a connection attribute.

Assume that the following workloads are defined in the catalog:
Table 1. Workloads in the catalog
Evaluation order
Workload name
APPLNAME
SYSTEM
_USER
SESSION
_USER
SESSION
_USER
GROUP
SESSION
_USER
ROLE
CURRENT
CLIENT
_USERID
CURRENT
CLIENT
_APPLNAME
CURREN
CLIENT
_WRKSTNNAME
CURRENT
CLIENT
_ACCTNG
1 ITEMINQ   KYLE, GEORGE   RETAIL, SALES          
2 DAILY TRANS REPORT AppC   KYLE, CAROL SALES, ACCOUNTING          
3 SALES SUMMARY AppA, AppB       ACCOUNTANT, FINANALYST        
Assume that a database connection with the following attributes is established:
Table 2. Database connection attributes
APPLNAME
SYSTEM
_USER
SESSION
_USER
SESSION
_USER
GROUP
SESSION
_USER
ROLE
CURRENT
CLIENT
_USERID
CURRENT
CLIENT
_APPLNAME
CURREN
CLIENT
_WRKSTNNAME
CURRENT
CLIENT
_ACCTNG
AppC LINDA KYLE SALES ACCOUNTANT LINDA NULL NULL Business Account

When the first unit of work is submitted, the data server checks each workload in the catalog in ascending evaluation order and stops when it finds a workload whose connection attributes match those supplied by the connection. When it checks the workloads, the data server compares the connection attributes in deterministic order.

First, the data server checks the ITEMINQ workload:
Table 3. ITEMINQ workload in the catalog
Evaluation order Workload name APPLNAME
SYSTEM
_USER
SESSION
_USER
SESSION
_USER
GROUP
SESSION
_USER
ROLE
CURRENT
CLIENT
_USERID
CURRENT
CLIENT
_APPLNAME
CURREN
CLIENT
_WRKSTNNAME
CURRENT
CLIENT
_ACCTNG
1 ITEMINQ   KYLE, GEORGE   RETAIL, SALES          
The data server checks for a match between the submitted connection attributes and the ITEMINQ workload. The attributes are checked in the following order:
  1. APPLNAME. Because the APPLNAME attribute is not set for the workload, any value, including a null value, that is passed by the connection matches.
  2. SYSTEM_USER. The connection passed a value of LINDA. However, the ITEMNO workload values are KYLE and GEORGE. No match occurs for this attribute.
The data server stops trying to match the ITEMNO workload and the connection and proceeds to the second workload in the list, DAILYTRANSREPORT:
Table 4. DAILYTRANSREPORT workload in the catalog
Evaluation order Workload name APPLNAME
SYSTEM
_USER
SESSION
_USER
SESSION
_USER
GROUP
SESSION
_USER
ROLE
CURRENT
CLIENT
_USERID
CURRENT
CLIENT
_APPLNAME
CURREN
CLIENT
_WRKSTNNAME
CURRENT
CLIENT
_ACCTNG
2 DAILYTRANSREPORT AppC   KYLE, CAROL SALES, ACCOUNTING          
The data server compares the attributes of the DAILYTRANSREPORT workload and the connection in deterministic order:
  1. APPLNAME. Both the workload definition and the connection have a value of AppC, so a match occurs.
  2. SYSTEM_USER. Because the SYSTEM_USER attribute is not set for the workload, any value, including a null value, that is passed by the connection matches.
  3. SESSION_USER. The SESSION_USER value passed on the connection is KYLE, which is a match with one of the workload SESSION_USER values. If the connection had passed CAROL, this would also be a match because both KYLE and CAROL are specified as part of the DAILYTRANSREPORT workload definition.
  4. SESSION_USER GROUP. The SESSION_USER GROUP value passed on the connection is SALES, which matches the SALES value specified for the workload SESSION_USER GROUP attribute. If the connection had passed ACCOUNTING, this would also be a match because both SALES and ACCOUNTING are specified in the workload definition.
  5. SESSION_USER ROLE. Because the SESSION_USER ROLE attribute is not set for the workload, any value passed by the connection matches.
  6. CURRENT CLIENT_USERID. Because the CURRENT CLIENT_USERID attribute is not set for the workload, any value passed by the connection matches.
  7. CURRENT CLIENT_APPLNAME. Because the CURRENT CLIENT_APPLNAME attribute is not set for the workload, any value passed by the connection matches.
  8. CURRENT CLIENT_WRKSTNNAME. Because the CURRENT CLIENT_WRKSTNNAME attribute is not set for the workload, any value passed by the connection matches.
  9. CURRENT CLIENT_ACCTNG. Because the CURRENT CLIENT_WRKSTNNAME attribute is not set for the workload, any value passed by the connection matches.

After processing all of the connection attributes and finding a matching workload for the connection, the data server checks whether the session user has the USAGE privilege on the workload. In this situation, assume that the session user KYLE has the USAGE privilege on the DAILYTRANSREPORT workload. Because all connection attributes match and the session user has the USAGE privilege, the connection is assigned to the DAILYTRANSREPORT workload.