-->
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: Migrating data
PostPosted: Fri Apr 22, 2005 7:48 am 
Newbie

Joined: Tue Jan 11, 2005 12:47 pm
Posts: 5
Usual apologies if this has already been answered.
Tried rtfm but a lot of info. so slight possibility I may have missed something :-)

I'd like to migrate data between two databases.
I'm doing some initial testing on a staging machine and then re-deploying to another machine and I'd like the persisted data from the staging machine to be migrated to the deployment machine.

So, two databases with the same schema. Obviously can't just export and import the data as there will be conficts with sequences etc.

I've tried reading all the objects using one session factory then saving them using another but am getting a ConstraintViolationException with the message "Could not synchronize database state with session".

I had thought this was due to the hibernate identifiers being set so I've had a stab at reflectively setting them to null with very similar results.

The reflection code's getting a little ungainly and it occurs to me that hibernate does something very similar.

Is there any way to 'clear' detached objects?
Is there a better way to do this?

Cheers,
Jeremy.


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.