Hi Bruno, For grins, could you possible try doing commitChanges() instead of commitChangesToParent()? Just curious if the child context could be in play here.
Thanks, mrg On Sun, Jul 31, 2011 at 1:41 PM, Bruno René Santos <[email protected]> wrote: > Hi Michael, > > This time I am using MySQL. And yes I'm using > the org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy. I am willing > to "fool" cayenne by saying that the key is database generated but being a > foreign key that would not be true and also cayenne is ignoring the value i > am putting on the field... which is the weird part. As I said before > commitchangestoparent I check the newObjects() and the key is properly > filled. > > I have the auto_ok_support table but I am not using it. Would it help to > drop it? But even so cayenne shouldn't use it on this case. > > Thanx > Bruno > > On Sun, Jul 31, 2011 at 2:16 PM, Michael Gentry <[email protected]>wrote: > >> Hi Bruno, >> >> I've not tried that scenario before. What database are you using? I >> believe in the past you said you are using Oracle? If so, maybe set >> the modeler to use a sequence for that table instead of the default >> and see if that clears it up. Also, I'm assuming you are skipping the >> option of creating the DB schema on startup if missing? (This would >> try to create the AUTO_PK_SUPPORT table if missing.) >> >> mrg >> >> >> On Sun, Jul 31, 2011 at 5:08 AM, Bruno René Santos <[email protected]> >> wrote: >> > Hello all, >> > >> > I have a dbEntity with thre foreign keys that are also its primary keys. >> > During the application I fill all three fields correctly with the objects >> > that should be referenced. Before the commitchangestoparent I check the >> > newObjects array and all objects are filled correctly. >> > >> > On the Modeler I left the Default PK generation because none of the PK >> will >> > be generated, as they are also foreign keys. But even so Cayenne tries to >> > use the AutoPkSupport generation for only one of the foreign keys... >> raising >> > an integrity error. >> > >> > Anybody knows what can be happening? I'm using cayenne 3.0.2 >> > >> > Regards >> > Bruno Santos >> > >> > -- >> > Bruno René Santos | [email protected] | Gestor de Projectos | Analista >> | >> > Programador | Investigador >> > >> > Holos - Soluções Avançadas em Tecnologias de Informação S.A. >> > Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque >> > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal >> > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt >> > >> > This email and any files transmitted with it are confidential and >> intended >> > solely for the use of the individual or entity to whom they are >> addressed. >> > If you are not the intended recipient or the person responsible for >> > delivering the email to the intended recipient, be advised that you have >> > received this email in error and that any use, dissemination, forwarding, >> > printing, or copying of this email is strictly prohibited. If you have >> > received this email in error please notify Bruno René Santos by telephone >> on >> > +351 210 438 686 >> > >> >> > > > -- > Bruno René Santos | [email protected] | Gestor de Projectos | Analista | > Programador | Investigador > > Holos - Soluções Avançadas em Tecnologias de Informação S.A. > Parque de Ciência e Tecnologia de Almada/Setúbal . Edifício Madan Parque > Rua dos Inventores . Quinta da Torre . 2825 - 182 Caparica . Portugal > Phone: +351 210 438 686 . Fax: +351 210 438 687 . Web: www.holos.pt > > This email and any files transmitted with it are confidential and intended > solely for the use of the individual or entity to whom they are addressed. > If you are not the intended recipient or the person responsible for > delivering the email to the intended recipient, be advised that you have > received this email in error and that any use, dissemination, forwarding, > printing, or copying of this email is strictly prohibited. If you have > received this email in error please notify Bruno René Santos by telephone on > +351 210 438 686 >
