-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate - taking database name as user input...
PostPosted: Fri Dec 02, 2011 3:45 am 
Newbie

Joined: Wed Jun 18, 2008 7:30 am
Posts: 3
Location: Delhi
Hello,

I have worked in hibernate for one database only.
I am working on a project, where the database name will be taken as input from user. The user will then be allowed to work with that database.

Though the database name will be taken as input, all database will be having same schema architecture...So one cfg.xml will help...

I learnt from various sites, how to create dynamic configuration at runtime...
Changing the dbsource property of the configuration... and then creating the session factory...

I will take the database name from user, create the configuration and then build a session factory...

One thing that is bothering me....changing the hibernate configuration will impact all the users logged in. While my requirement is user - database one to one mapping...

Please advise on this...how i should take this?
Even if i create different session factories, should i keep user specific session factory in UserContext?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.