Suppose an application wants to migrate certain persistent objects from one database to the next, e.g. there is a persistent object on a development server and either no object or an old version of an object on a production server, and you want to update the production server to contain the new object/data with the same ids. Seems like you'd be using 2 separate sessions one for each databse, but from there I wasn't sure what would work. replicate() says it will work with transient objects, but by definition things pulled from the development server are not transient. I guess I could try to "load" into a transient object from one session and then try to replicate, or then try to save?
What is the correct paradigm for what I am trying to do? Is there a name for this kind of thing? What methods can I look at?
|