Consultor Eletrônico



Kbase 19935: How to limit the maximum number of sessions a user can start?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   9/15/2008
Status: Verified

GOAL:

How to control the number of connections with 4GL code

GOAL:

How ensure the number of database connections does not exceed a set limit using the 4GL

GOAL:

How to limit the maximum number of sessions a user can start

GOAL:

How to control how many connections a user can have to one database

GOAL:

Limiting the user sessions

GOAL:

How to limit the number of user connections using 4GL code

GOAL:

How to implement license counting in a 4GL based application

FACT(s) (Environment):

Progress 8.2x
Progress 8.3x
Progress 9.x
OpenEdge 10.0x

FIX:

This solution relies on using the Virtual System Tables (VST). In version 8.2x and 8.3x these need to be enabled by using proutil sports -C enablevst . In later releases the VSTs are always enabled.

Use a FOR EACH ... WHERE .... loop on the _Connect VST to count the current number of connections, and if the number of connections exceeds the limit, end the session using the QUIT statement.

Set the WHERE clause to either filter by username (_Connect._Connect-Name) and/or by connection type (_Connect._Connect-Type) as required.

Note: When filtering by connection type, the values SELF and REMC indicate user connections.