Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Need advice on generator strategy
PostPosted: Wed Mar 21, 2012 6:27 pm 
Newbie

Joined: Wed Mar 21, 2012 6:17 pm
Posts: 2
I have a requirement in which I have to save one object graph to db1, get the Ids of all objects in the object graph from this database, and save the object graph with Ids in db2(read it as database number 2, not db2, literally). The requirement is that both databases should have the same data. One more constraint is that both of these databases are same and they use sequence on each table. I have been trying different generator strategies but nothing is working for me. For example, I tried to set sequence generator in mapping file, when I save in 1st db, it works fine and I get the Ids but when I try to set this id to the object and try to save in the db2, I get different Ids returned from db2.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.