-->
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: Is it possible to update a table in another schema?
PostPosted: Sun Jul 02, 2006 9:03 am 
Newbie

Joined: Tue Jun 27, 2006 2:20 pm
Posts: 2
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:
Hibernate 3.0

Name and version of the database you are using:
Oracle 9i

I have this condition where i need to update a table that is not in my own schema of the database but lies in some other schema.

Does any one know whether there is a possibility of updating or inserting new data in a table that exists in another schema of the Database other than the one where your application's hibernate.cfg.xml points.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 03, 2006 8:02 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Technically : no problem. You just have to declare a SessionFactory object for each database. Then just get a session of the right SessionFactory to apply your request, and you're done.

The only thing is : I think that if you want to do a transaction including insertion in one schema, then another, it's called a two phase commit and I don't know if it's easily manageable, 'cause I've never done it.

But without this, you should manage to do what you want with not too much difficulties.

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


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.