The system uses the sp_getapplock() system stored procedure to create an exclusive application lock using the BUSINESSPROCESSSTATUSID as the application lock's resource name (@Resource). Using sp_getapplock guarantees serial access to application database code and database objects by issuing an application lock. This is a way to synchronize code, and it effectively blocks other users from entering the section of code until the application lock is released. Any process calling sp_getapplock with the same @Resource variable will be blocked until the application lock is released. The resource/lock name is a unique string specifying a name that identifies the lock resource. The application lock is made on the database connection. Since the BUSINESSPROCESSSTATUSID is a global unique identifier, the resource/lock name will be unique. The lock mode is exclusive. The lock owner is set to "Session," meaning the code will ultimately have to call sp_releaseapplock() to release the application lock.