users@glassfish.java.net

[JPA] replication of entities in Java SE

From: <glassfish_at_javadesktop.org>
Date: Tue, 11 Sep 2007 09:11:00 PDT

So, I have two PersistenceUnits which have the same entity classes, but refer to different databases, say DB1 and DB2.

I want to retrieve objects from DB1 and store them in DB2 (and maybe update something into DB1).
Which is the best way to this in java SE (no jta)?

I have two parallel transactions in two different EntityManagers from two different EntityManagerFactories. I can read objects from DB1, make copy of each object and save it into DB2 and the copy will have a different ID..
[Message sent by forum member 'bodrin' (bodrin)]

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