users@glassfish.java.net

Re: jpa and object duplication/cloning

From: <glassfish_at_javadesktop.org>
Date: Tue, 08 Jan 2008 05:07:50 PST

I want to persist an object and all objects that it references with completely new database rows, not merge.

Here is an example of my use case:
I have four machines, A, B, C and D.
A and B both have a derby and java program using JPA for persistence.
C and D both have a program that access A and/or B to get marshalled objects, retrived from DB using JPA.
Root object retreived from A or B can be merged back to their source machine. This is no problem.
Nevertheless, i need to be able to transfer objects from A to/from B through C and/or D. When doing this, i absolutely need to write a brand new object graph, not update the eventual other objects having the same ID. This is the case i currently have. When i persist objects gotten from one machine to the other one, objects having the same ID overwrite the ones already present.

This is a simplified scheme. there can be multiple servers and multiple clients and not only we should transfer data from any to any other but also any client can create new objects to be saved.
I do not need to synchronize servers but really to transport data from one to an other.
[Message sent by forum member 'pepe' (pepe)]

http://forums.java.net/jive/thread.jspa?messageID=252709