Lock Me Up
Previous Topic  Next Topic 

Locks


Two main sypes of Lock exist, Session Locks and Locks


Session Locks

A session lock is set on the start of your session, and rubbed out at the end. When your next session starts, it clears all session locks belonging to your PC. In a terminal server session these locks are keyed with the Session Id of the session you are running.


The Lock ID of the Session Lock is the Session ID

The Session ID is made up from

Your Nominated Default or menu assigned TLA at startup.

The Process ID of the Program you are running (as defined in the Task Manager)

The Process Name of the Program you are running (as defined in the Task Manager)

The Session ID you are running under (Workstations and services are usually zero)

The Defined HOSTNAME of the PC or Terminal Server (not the terminal server client PC)

The Main IP address of the PC or Terminal Server

Your USER ID on the PC or Terminal Server Session

The Start time of the Program running, in UTC (same as GMT)

viz


Talons SQL.Globals.strRegistryTLA & "|" & Process.GetCurrentProcess.Id.ToString.ToLower & "|" & Process.GetCurrentProcess.ProcessName.ToString.ToLower & "|" & Process.GetCurrentProcess.SessionId.ToString.ToLower & "|" & Talons SQL.Globals.HOSTNAME & "|" & Talons SQL.Globals.IPADDRESS & "|" & Talons SQL.Globals.USER & "|" & Format(Process.GetCurrentProcess.StartTime.ToUniversalTime, Talons SQL.Globals.LONG_DATE_TIME)


Locks

Locks are of many subtypes


File Locks

used to lock access to an import file, the Lock is set till all files in a set are completed.

COMPANY_TLA & "/" & filename of loading file while loading a file

Process Locks

Used to lock access to a process such as bedday recalculation where simultaneous access by seperate users could cause lock step or leap frog  processing

COMPANY_TLA & "/" & ProcessName

Sleep Locks

Used to show when the Service is sleeping  - and untill when

Action Locks

Used to Show when the Service is doing something

Episode Locks

Set when a specific episode is being processed in the Bedday products routines.

COMPANY_TLA & "/" & CAMPUS_TLA & "/" &  Episode to lock an episode

Menu Locks

Shows who is doing what menu option, only set by interactive sessions.

COMPANY_TLA & "|" & FormName & "|" & Menu & "|" & Option

Table Locks

Set  to lock access to a table when major updates are underway

COMPANY_TLA & "/" [& CAMPUS_TLA & "/"] & TableName for a type of table lock

REINDEX Lock

Set when the REINDEX is active by the service last thing some nights of the week. When set , menu access to other than exit is not allowed. The REINDEX canot be set while users are active in menu processes.

Reindex_Database with Process = REINDEX while reindexing






A note about locks, these Locks are more CHALK MARKS than actual locks, we make our mark on entry and rub out on exit. They Hold no server resources other than a record in a table, no page locks, process locks, table locks, cursor locks are used.

All locks have an expiry date after which it is ignored and deleted.


Data Control

This is a special lock set by process that would probably run better if they had the database to themselves, import fresh data, extracts of some types