-->
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.  [ 3 posts ] 
Author Message
 Post subject: How to Query Multiple Data Stores
PostPosted: Wed Jun 23, 2004 7:45 am 
Newbie

Joined: Wed Jun 23, 2004 7:35 am
Posts: 1
Hi,
I am very new to Hibernate (2.1.3). I have a problem. I have a database design such that some data is stored in a relational Database whereas some data is stored in XML Files.

Now i need to Query the two objects which contain the related data.
Say for ex : Product Id's in Relational Database A and Product details in
XML Format. Now my query needs data from both the data stores.

I have created a object which maps to corresponding tables in Relational Database A, it fetched the data using Hibernate API.

Now the second Object is created using my own functions from the XML data but which needs to deal with the first object created by hibernate API.

-> How do i query 2 heterogenous objects ?
-> Is there any way in Hibernate such that i can use XML Files as database
-> Is there any way of querying the objects which have differenr "Sessions" i.e. one object is being created from RDB-A whereas Other from RDB-B.


Thanks in Advance
Sanket


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 23, 2004 8:36 am 
Regular
Regular

Joined: Mon Nov 24, 2003 6:36 pm
Posts: 105
One possble way to handle this is via oracle database links.
I've done some projects this way, but it can be difficult to troubleshoot query tuning at times.
Of course you can manually handle the situation using multiple data sources, using 2 sessions. Of course you have to break it up into multiple queries to each system seperately if you are joining them.


--James


Top
 Profile  
 
 Post subject: Re: How to Query Multiple Data Stores
PostPosted: Thu Jun 24, 2004 8:36 am 
Senior
Senior

Joined: Tue Nov 25, 2003 9:35 am
Posts: 194
Location: San Francisco
sanket_deshpande wrote:
-> How do i query 2 heterogenous objects ?


The way I model this is that the DB has some reference in it that points to files.

sanket_deshpande wrote:
-> Is there any way in Hibernate such that i can use XML Files as database


No, not in a general sense.

sanket_deshpande wrote:
-> Is there any way of querying the objects which have differenr "Sessions" i.e. one object is being created from RDB-A whereas Other from RDB-B.


You would define 2 different factory configurations that point to the different DBs. I do not know a way to query across both sessions simultaneously.


Sherman


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.