-->
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: Conceptual Question...
PostPosted: Sun Aug 13, 2006 2:00 am 
Newbie

Joined: Sun Aug 13, 2006 1:28 am
Posts: 2
Location: Boulder, CO
Hey All,

Here's the abstracts of what I have going on...
In the first JVM, we've got a whole Hibernate persistence layer working for us. As an object in the object graph is updated, we send a COPY of the the entire graph over a WS interface to the second JVM. The second JVM now needs to take the data and put it into another (legacy) DB...

The transactions are always one-way between the first and second JVM. (We implemented equals() well so there shouldn't be problems with that...)

So, basically in the second JVM, I have a transient version of some object graph, which may or may not already have a stale version of the same objects in the DB.

My question is, how do I get the new information in the transient version of the object graph into the DB, without creating multiple multiple rows, or having Hibernate pitch a fit, because the data already exists (in a stale state)?

We are currently working around this by exposing (for reading only) the internal generated ID in the 1st JVM, and using that ID as the ID in the tables of the 2nd JVM. But, this kind of feels like a hack...

I've read about the merge() function, but that doesn't seem like it would solve our problems. (I think it assumes we're working with a DETATCHED object, not "overlaying" the data from a transient object graph...)

One other possible solution is to write a deep copy functionality, but that seems like it'd be overly tedious.

Is there an "overlay()" capability to assemble data between an updated TRANSIENT version of the data with a stale PERSISTED version of the data. How else do we solve this?


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.