-->
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.  [ 2 posts ] 
Author Message
 Post subject: how to use c
PostPosted: Mon Apr 17, 2006 4:31 pm 
Newbie

Joined: Tue Mar 28, 2006 11:46 am
Posts: 10
Hey,

Hibernate version: 3.1.3 and my backend database is Oracle.

I have two database users: dbuser1 and dbuser2. Some tables are created for dbuser1 and some for dbuser2. I always wants to logon to the db server using those user credentials and use their session to insert records into the table.

Now my question is when a session factory is created you can just use one user credentials (defined in hibernate.cfg.xml file). At one time I can only use dbuser1 or dbuser2. Is there a way in hibernate to create jdbc connections for both users so that I can decide which user connection to use based upon tables.

Thanks.

Sanjeev Singal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 17, 2006 6:28 pm 
Newbie

Joined: Sat Apr 15, 2006 4:50 am
Posts: 9
Perhaps you could create views in the schema of user1 on the tables of user2 and then use user1 only from within your application.

Or you could use two completely separate session factories. But that could possibly raise some transaction issues and problems if you want to mix objects from different sessions.

Regards,
Volker


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

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.