-
FEATURED COMPONENTS
First time here? Check out the FAQ!
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4372206
By: cmaniac
Hi all of you
I hope that anybody can help me with this issue. I have my webapp that works perfectly (ZK,+hibernate) but a I have this question, how can I change the hibernate session at runtime so it works with diferent datasource? something like this
escenario:
1X the webapp, initialize with the default connection pool (defined trought hibernate.cfg.xml)....
2X an user attempts to loggin to de webapp... (it enters OK... ) 3X then the webapp MUST to change the hibernate connection so it now point to another datasource with the user/pass of
the user that just logged in.
4X an then and so on... the webapp connects with that datasource
it can be done?.... how I do that?
Hope I explain well!
Thanks
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4372693
By: exactt
i did something like that using schemas as offered by postgresql. i made a sessionfactory for each schema. at factory initialization you can set the "hibernate.default_schema" property.
i don't know if this approach is very efficient but you might wanna give it a try...
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4373173
By: cmaniac
hi..
well i'm using Oracle 10g, I realize that i have to create a new hibernate session, but how about ZK+hibernate I mean, I have to implement zk + hibernate fix in order to work with the database with no problems (you know all about hibernateutil, zk.xml fix.. etc... etc...).
Or can tell me, how you do it? or enybody else?
- can I make a new hibernate session??
thanks
Orignial message at:
https://sourceforge.net/forum/message.php?msg_id=4393683
By: henrichen
I guess that you have to create a new SessionFactory for a different datasource.
And you have to use the correct SessionFactory to create correct session and so on.
/henri
Asked: 2007-06-20 21:57:28 +0800
Seen: 250 times
Last updated: Jul 03 '07