-->
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: Replication for Synchronization between two DB (lazy="t
PostPosted: Tue Aug 29, 2006 9:43 am 
Newbie

Joined: Tue Aug 29, 2006 4:29 am
Posts: 6
Location: St. Petersburg
Hello Guys!

I need to syncronize the data between two different databases with the same table strucure.

All entities are declared with an option lazy="true".

Firstly I'd like to add an object which is in the 1st DB and is new to the 2nd one. So I need to copy this object from the 1st to the 2nd DB.

My steps:
1. Open session which points to the 1st DB.
2. Load the entity.
3. (I don't close the session).
4. Open another session which points to the 2nd DB.
5. Trying to replicate/merge this object.

Surely I can't do that because the replicate method requires this object to be detached from the 1st session (step 3). But I need to keep the session opened because the entity was not fully loaded. And I do not want to change to lazy="false" - objects are really big and complex.

Could anyone please provide a solution for this situation or give an another way of databases synchronization? Any help would be very appreciated.


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.