<snip>
Michael Dick wrote: > > On Fri, Aug 28, 2009 at 11:40 AM, Daryl Stultz <[email protected]> wrote: > >> Thus far the exception has occurred on 2 different properties of my main >> entity (ShippingInstructions and, I don't know, "ShippedBy"). In both >> cases >> ShippingInstructions and ShippedBy were entites already existing in the >> database. This is indicated by the primary key that follows the >> "FailedObject" (1981 above). >> >> As a test, I instantiated a ShippingInstructions and persisted it. I then >> instantiated another ShippingInstructions and manually copied all the >> properties (including the ID) from the persisted instance to the new >> instance. I instantiated an Order and set the ShippingInstructions from >> the >> "clone". I persisted the Order and it worked fine. So the >> cloned ShippingInstructions object was never associated with an em, but >> the >> persist was successful. >> >> I understand that I can't persist a new entity with a property that is >> also >> a new entity without Cascade.PERSIST, but that is not my case. > > > So you do have Cascade.PERSIST set? Otherwise the scenario above should > fail. I haven't gone back and reviewed the earlier threads, just ignore > this > part if it's already been covered. > > After reading the preceding paragraphs again i think I understand what you're saying, sorry for any confusion.. The scenario you've described doesn't sound right (maybe I need a refresher). The new ShippingInstructions object should be unmanaged unless you've managed to inject a StateManager into it (which would be a good trick). Out of idle curiosity do you have any properties set in persistence.xml? Or should I be able to reproduce this with OpenJPA's default configuration? -mike -- View this message in context: http://n2.nabble.com/SingleFieldManager-preFlushPC-tp3534271p3536258.html Sent from the OpenJPA Developers mailing list archive at Nabble.com.
