Having multiple instances of sessionFactory

I am putting the legacy application to sleep 5 and I am having problems with the login phase. Here's how it works (I can't change this):

  • the user first connects to the Oracle database with a common username / password (the same for all users).
  • then the user starts the stored procedure "login" and enters a unique password as a parameter
  • procedure returns user user name / password Oracle DB
  • the user disconnects from the database and reconnects using the credentials provided by the stored procedure.

I am currently creating one instance of sessionFactory for each connected user, but I am worried that this will affect performance. Is there a better way to do this?

thanks

+6
source share
1 answer

Hibernate Multi-user mode with the “Separate database” strategy will work even if you are actually connecting to one database but to different credentials. MultiTenantConnectionProvider must be specified to return a connection with the correct username and password.

+1
source

All Articles