Hi Joerg, On Mar 8, 2006, at 6:10 PM, Joerg von Frantzius wrote:
Craig L Russell schrieb:Does that mean that makePersistent() must not insert detached instances for which it cannot find an object in the datastore?Hi Erik,When you invoke makePersistent on a detached instance, the instance must exist in the database. You don't insert it at commit. [..]
Yes.
In 12.6.7 it has "For a detached instance, they [the methods makePersistent() and makePersistentAll()] locate /or create a persistent instance/ with the same JDO identity as the detached instance, and merge the persistent state of the detached instance into the persistent instance."I'm asking because our replication algorithm relies on that.
Good.
Also I find it confusing that the method most prominently used for inserting new objects shouldn't do so for detached instances.
There is a bunch of history that you should look at, most of which is in the jdo-dev archives. Bottom line, we used to have a different API, attachCopy, but we looked at what it had to do for transient and detached instances and decided that it wasn't worth making a different API for attaching detached instances.
Regards, Craig
Craig On Mar 8, 2006, at 7:14 AM, Erik Bengtson wrote:Hi,What happens when we invoke makePersistent on a detached instance that was deleted by another isolated process? I suspect that we raise an exceptioninstead of reinserting it for a second time. Is that right? Maybe this can be clarified in the spec. Regards,Craig RussellArchitect, Sun Java Enterprise System http://java.sun.com/products/ jdo408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
