I have unchecked all the "To dep PK" boxes. The PK generation setting is default. The log output is as follows:
INFO QueryLogger: INSERT INTO ScanFiles (SCANFILE_ID, name) VALUES (?, ?) INFO QueryLogger: [bind: 200, 'ScanNumber B1'] INFO QueryLogger: === updated 1 row. INFO QueryLogger: [bind: 200, 'ScanNumber A1'] INFO QueryLogger: *** error. It seems the PK generator is creating a duplicate SCANFILE_ID of 200 (which is the default starting value in AUTO_PK_SUPPORT. Neil Aristedes Maniatis-2 wrote: > > > On 03/10/2007, at 7:32 AM, pinkybum_nabble wrote: > >> I get an exception which indicates that the database tried to create a >> Dependent entry with a duplicate primary key. The only >> configuration which >> alleviates this problem and creates unique Dependent keys is >> checking the >> "To dep PK" checkbox on the dependent side of the relationship. > > This should not be ticked in ordinary use. It is for special cases > such as a one-to-one relationship model. > > http://cayenne.apache.org/doc/to-dep-pk-checkbox.html > > I'd be looking at your primary key generation strategy. Are you using > the default? What key is being created in the database once you add > and commit one record? > > > Ari Maniatis > > > > --------------------------> > Aristedes Maniatis > phone +61 2 9660 9700 > PGP fingerprint 08 57 20 4B 80 69 59 E2 A9 BF 2D 48 C2 20 0C C8 > > > > > -- View this message in context: http://www.nabble.com/To-dep-PK-tf4558289.html#a13010250 Sent from the Cayenne - User mailing list archive at Nabble.com.
