What db are you using? Can you post a small unit test that exhibits the behavior that you are hitting?
-- Thanks, Rick On Mon, May 10, 2010 at 7:26 AM, Midyat <[email protected]> wrote: > > > Hello, > > I have two entity classes. > ClassA and ClassB. > ClassB has a property ClassA, so in my tables (autogenerated by > persistence.xml) there is a foreign key from ClassB to ClassA_id > > I first persist my ClassA entity. > Thereafter I persist my ClassB entity. > Thereafter I persist again my ClassB entity (because a field changed). > > The strange thing is, when I run this program the very first time, it fails > with the error below. After failing a first time, it works fine !!! > > Exception in thread "main" <openjpa-2.0.0-r422266:935683 nonfatal store > error> org.apache.openjpa.persistence.EntityExistsException: An object of > type "src.ClassB" with oid "0" already exists in this context; another > cannot be persisted. > > Why is this failing the first time? > And why not the other times? > > Thank you! > -- > View this message in context: > http://openjpa.208410.n2.nabble.com/An-object-of-type-src-StatusUpdate-with-oid-0-already-exists-in-this-context-another-cannot-be-persi-tp5030272p5030272.html > Sent from the OpenJPA Users mailing list archive at Nabble.com. >
