accessControl

checkInAllObjects

Description

Releases all objects that are checked out by the current client session. This action is particularly useful when a session does not have an active transaction and needs to release locks on metadata objects. It acts as a global check-in for the session.

accessControl.checkInAllObjects <result=results> <status=rc>;
Data Preparation View data prep sheet
Data Creation: Checking Out an Object

To demonstrate `checkInAllObjects`, we first need an object to be in a 'checked-out' state. This code loads the `cars` table into memory and then uses the `checkOutObject` action to place a lock on it. This simulates a scenario where an object is being edited or reserved.

Copied!
1PROC CAS;
2 TABLE.loadTable / caslib="casuser" path="cars.sashdat" casout={name="cars", replace=true};
3 ACCESSCONTROL.checkOutObject / uri="cas/caslibs/casuser/tables/cars";
4RUN;

Examples

This example shows the simplest way to use the `checkInAllObjects` action. It releases all locks on objects that were previously checked out by the current session.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 ACCESSCONTROL.checkInAllObjects;
3RUN;
Result :
The action returns a success status, indicating that all objects checked out by the session have been checked back in. Any metadata locks held by the session are released.

This detailed example demonstrates a complete workflow. First, a table is checked out. The `whatCheckoutsExist` action is used to verify the checkout status. Finally, `checkInAllObjects` is called to release all locks, and the status is verified again to confirm the check-in was successful.

SAS® / CAS Code Code awaiting community validation
Copied!
1PROC CAS;
2 /* Step 1: Ensure a table is loaded and checked out */
3 TABLE.loadTable / caslib="casuser" path="cars.sashdat" casout={name="cars", replace=true};
4 ACCESSCONTROL.checkOutObject / uri="cas/caslibs/casuser/tables/cars";
5 
6 /* Step 2: Verify the checkout exists */
7 ACCESSCONTROL.whatCheckoutsExist;
8 
9 /* Step 3: Check in all objects for the session */
10 ACCESSCONTROL.checkInAllObjects;
11 
12 /* Step 4: Verify the checkout is released */
13 ACCESSCONTROL.whatCheckoutsExist;
14RUN;
Result :
The output from the first `whatCheckoutsExist` call will list the 'cars' table. After `checkInAllObjects` runs, the output from the second `whatCheckoutsExist` call will be empty, confirming that the object has been successfully checked in.

Associated Scenarios

Use Case
Standard Workflow: Multi-Table Metadata Update

A Data Governance team needs to update the column labels and formats for multiple sensitive tables (Clients and Transactions) to ensure regulatory compliance. The tables must be...

Use Case
Performance/Volume: Batch Process Emergency Cleanup

A nightly ETL batch process manages temporary staging tables for different regions. If the process encounters a logic error mid-stream, it leaves multiple tables in a 'checked-o...

Use Case
Edge Case: Misuse Inside an Active Transaction

A junior developer attempts to use `checkInAllObjects` inside an active database transaction. According to the documentation, this is incorrect usage. The system must ignore the...