Suddenly million of calls of this query:(@USERID int,@TENANTID int)SELECT IS_ACTIVE, USERNAME FROM OSSYS_USER WHERE ID = @USERID AND TENANT_ID = @TENANTID
Does anyone know where this comes from ?Did anything change in outsystems ?
I wonder why not cache exists which gets updated when anything in DB changes instead of calling the db to check permanent if user is active.
This query is from the OutSystems authentication/runtime layer, checking the user's authentication information in OSSYS_USER.
OutSystems does have an Authentication Cache, so this query should not necessarily execute on every request. Check Service Center → Administration → Security → Applications Authentication → Cache Time In Minutes.
If you're suddenly seeing millions of executions, check whether the cache setting changed, authentication/session behaviour changed, or a recent platform update coincides with the spike.
Official documentation:OutSystems – Configure app authentication
The documentation specifically explains that the authentication cache prevents database validation on every request.Thanks and regards,Akshay Deshpande
That query is from the OutSystems built‑in authentication / security layer and is expected behavior; it’s how the platform checks that a user is still active and valid for the tenant on each request.
The pattern:
(@USERID int, @TENANTID int) SELECT IS_ACTIVE, USERNAME FROM OSSYS_USER WHERE ID = @USERID AND TENANT_ID = @TENANTID
is executed by the platform runtime (not your code) whenever it needs to validate the current session’s user, e.g.:
CheckUserSession
GetUserId
Nothing in your OML will show that query; it’s generated and executed by the platform internally.
If you suddenly see millions of calls, typical reasons are:
Traffic / load increased More requests → more session validations → more calls to OSSYS_USER.
OSSYS_USER
Short session timeout / session loss If session timeout is small or sessions are being lost (e.g. load balancer/cookie issues), users get more fresh sessions, causing more checks.
More role checks or redirects If you recently added more Check<Role> logic, security redirects, or On Begin Web Request logic that forces extra requests, you’ll see more queries.
Check<Role>
New authentication plugin / custom auth Components like AD / MSAL / OAuth flows can cause extra internal validations depending on how you call Login or check users, similar to what is discussed in other auth‑related threads where platform repeatedly checks user active status and other properties in OSSYS_USER during login flows.Expired OutSysyems accounts are not being reactivated through Tablets
Login
The behavior itself (validating user against OSSYS_USER) is long‑standing in O11; it’s not a brand‑new feature.
For security and consistency reasons:
IS_ACTIVE = 1
You cannot turn this specific check off, but you can:
Verify if the volume is really abnormal Compare to the number of HTTP requests and concurrent sessions. One request usually implies at least one such validation query.
Check session configuration
Review your app logic
Monitor DB impact
ID
TENANT_ID
If you suspect a regression
In short: the query is from the platform’s normal session/user validation. A sudden spike usually reflects increased or more fragmented HTTP traffic/sessions, not a new OutSystems feature, and you can’t replace it with a cache without compromising security.
Hi Robert,
A correction to the AI reply above: there is a cache for this. The platform keeps the user’s authentication info in memory on each front-end, and you control how long it lives with “Cache Time In Minutes” under Service Center > Administration > Security (Akshay pointed to it too). The query you see runs when that cache entry is missing or expired. So when it suddenly jumps to millions, I would check these first:
To narrow it down, take the time the spike started and compare it with what was published around that date, and with the busiest URLs in the IIS logs for that period.
The query itself is cheap since it goes by primary key, but a sudden change in volume almost always comes from one of the points above.