Hello,
I am wondering how to rely on database context variables with PS 2021. We're using Oracle but the question applies to any DB.
In a c/s PB app, there are DB variables whose value lives for the life of the connection. The PB app can fetch these vars in DW SQL or eSQL.
After migration to PS 2021, login-related DB context is not accessible anymore, which requires the change of hundreds DWs (e.g. with one additional login retrieval argument) because the connection pooling makes each DB call open&close the connection and context vars do not persist.
In more details:
we store current user in Oracle database context, which we later get in PL/SQL as such:
vs_User := SYS_CONTEXT('VG_SECURITY_CONTEXT', 'USERID');
We also store the currently logged in user location (SITE1, SITE2, SITE3, etc) which is selected by the user at application start, in an Oracle *temporary* table. This table is accessible from DB for the whole connection time, and accessed via getter function so that we don't need to pass it explicitly in each function/procedure call.
This was implemented in this way to minimize the impact of the changes which needed to be done
to introduce a concept of "user location" in our application.
Most of the usage boils down to an additional condition applied in WHERE clause in SQL queries:
WHERE user_site = f_GetCurrentUserSite()
SQL conditions like above fail because context is lost.
With SnapDevelop REST API project I could manually control multiple calls to use same DB connection via data context.CurrentConnection.Open() and Close(), but with PS 2021 I just have PB DWs and ask PS to make to magic.
Is there any solution? Thanks,
.m
P.S.
In PS 2020 an acceptable workaround could be AEM -> Resources -> Data Source -> Dynamic Database Connection.
So there goes "migrating in a few days to powerserver" and "being 99.9% compatible" ...
Just my 2cts.
regards.
This topic is about how to keep a long-running database connection in PowerServer 2021 Beta. This feature is not supported at this moment, and we are still doing requirement analysis.
It seems that you are talking about another topic. What you said about connecting SQLCA with different users to handle user permissions is already supported. If you have encountered any issue with your database connection on permissions, please open a ticket in the Appeon Standard Support at https://www.appeon.com/standardsupport/.
Appreciate your understanding.
Regards, Logan