Migrating legacy DB with database users


I want to migrate a legacy database that is on top of a set of views in Oracle.
Part of the security is now based on the database user login. Is this also possible in the Cuba-framework?
So can I use the user/password to login to the database also?


Hi Juan-José,

Unfortunately you cannot use user’s login/password to connect to the database in a CUBA application, because all connections are interchangeable and stored in a common pool.

Hi Konstatin,

Would it be possible to use de db-per-tenant solution? Each tenant/user has it’s own database connection used with it’s own user credentials? Then each user is logged in with the database user/password and then the legacy stuff based on user-id can still work correctly.

Do you think that is an option?


Ok, maybe this is a bad idea. The thing is that there are some views using the sys_context(‘userenv’,'session_user) to filter some content.

Would it be possible to set a sys_context(‘cuba’,'user) and pass the Cuba-platform user to the database?

Maybe in the way done in this blog: https://technology.amis.nl/2015/03/08/set-values-for-bind-parameters-in-a-database-view-using-application-context-single-round-trip-context-manipulation-and-querying/

By rewriting/prefixing the select query’s sent to the database?