-->
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: Sync primary keys across multiple database instances
PostPosted: Thu Sep 15, 2005 6:18 pm 
Newbie

Joined: Thu Sep 15, 2005 5:58 pm
Posts: 1
I was curious if anyone out there has ever done a task like this. I have four database instances called dev, test, stage and prod. Each instance has it's own data. I have a requirement to insert new data in dev. I then need to programatically migrate the data, using struts/hibernate, from dev to test, test to stage, and stage to prod. Here's the hard part: I need to ensure the primary keys are the same in each environment. I've read the docs on the metadata xml id tag and the use of the generator tag. I think I have two options: 1) have a different set of mapping files in dev. Dev will use a generator class to manage the primary key sequencing. The mapping files in the other environments will be the same except they will use a generator type 'assigned'. 2) My other option is to use session.save( object, id ) where the 'id' is the primary key I want to insert. Does anyone have any thoughts about this?

Cheers,
Greg

Hibernate version:3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:oracle 9.2

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


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.