← All publications

Enforcing a shared access limit

UltraNow now checks organization capacity before activation and rechecks after reserving a session to handle competing requests.

Turn the configured cap into an activation decision

UltraNow now enforces an organization’s configured limit on concurrently active licenses in the activation flow. If the active-session count has reached the cap, another request is refused instead of being accepted on the strength of a dashboard estimate.

The limit applies to shared capacity. Several people may request access at almost the same moment, and the answer shown before they click can change before the application reserves a session. Enforcement therefore has to happen on the server as part of activation.

Check before and after the reservation

The implementation first counts non-stopped, non-expired sessions for the organization. It checks that count against policy before reserving a new session, then counts again after the reservation to detect competition that occurred between those operations.

When the second check finds that capacity has been exceeded, it attempts to abort the new activation and returns a capacity error. The expiry cleanup path remains relevant if that compensating action fails.

Be precise about the concurrency model

This is a pre-check and compensating recheck design, not a single lock-protected reservation transaction. That distinction shapes the tests we need: simultaneous requests, cleanup failures, and the state left behind after an activation is refused.

The release moves the limit into the server’s decision path and provides a defined response to a detected race. The next task is to measure and tighten that behavior under contention while keeping the employee’s access state understandable.

Further reading