Joined: Thu Oct 08, 2009 6:25 am Posts: 1
|
Hi,
I'm trying to establish per user connection with Hibernate in a webapplication. The only way I found is to implement custom ConnectionProvider with static legacyConnectionPool.
And before opening a session set the ConnectionProvider's static legacyConnectionPool to the connectionPool that will be held in an user's httpSession.
But I'm not sure if it's safe enough. I'm afraid of the following scenario.
1. First user sets his connectionPool in the ConnectionProvider 2. Second user sets his connectionPool in the ConnectionProvider 3. First user opens a HibernateSession and connects to the DB as the second user.
Any opinions or better solutions?
thanks in advance
|
|