Return-Path: X-Original-To: apmail-cayenne-user-archive@www.apache.org Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CCAEA66FF for ; Sun, 31 Jul 2011 19:31:43 +0000 (UTC) Received: (qmail 33956 invoked by uid 500); 31 Jul 2011 19:31:43 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 33944 invoked by uid 500); 31 Jul 2011 19:31:42 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 33936 invoked by uid 99); 31 Jul 2011 19:31:42 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2011 19:31:42 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (nike.apache.org: local policy) Received: from [209.85.161.43] (HELO mail-fx0-f43.google.com) (209.85.161.43) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2011 19:31:36 +0000 Received: by fxg17 with SMTP id 17so6388746fxg.16 for ; Sun, 31 Jul 2011 12:31:15 -0700 (PDT) Received: by 10.204.24.70 with SMTP id u6mr1002665bkb.351.1312140675191; Sun, 31 Jul 2011 12:31:15 -0700 (PDT) MIME-Version: 1.0 Received: by 10.204.68.4 with HTTP; Sun, 31 Jul 2011 12:30:55 -0700 (PDT) In-Reply-To: References: From: Michael Gentry Date: Sun, 31 Jul 2011 15:30:55 -0400 Message-ID: Subject: Re: weird PK generation To: user@cayenne.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org 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=E9 Santos w= rote: > Hi Michael, > > This time I am using MySQL. And yes I'm using > the org.apache.cayenne.access.dbsync.SkipSchemaUpdateStrategy. I am willi= ng > 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 wr= ote: > >> Hi Bruno, >> >> I've not tried that scenario before. =A0What database are you using? =A0= I >> believe in the past you said you are using Oracle? =A0If so, maybe set >> the modeler to use a sequence for that table instead of the default >> and see if that clears it up. =A0Also, I'm assuming you are skipping the >> option of creating the DB schema on startup if missing? =A0(This would >> try to create the AUTO_PK_SUPPORT table if missing.) >> >> mrg >> >> >> On Sun, Jul 31, 2011 at 5:08 AM, Bruno Ren=E9 Santos >> wrote: >> > Hello all, >> > >> > I have a dbEntity with thre foreign keys that are also its primary key= s. >> > During the application I fill all three fields correctly with the obje= cts >> > that should be referenced. Before the commitchangestoparent I check th= e >> > 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=E9 Santos | brunorene@holos.pt | Gestor de Projectos | Anali= sta >> | >> > Programador | Investigador >> > >> > Holos - Solu=E7=F5es Avan=E7adas em Tecnologias de Informa=E7=E3o S.A. >> > Parque de Ci=EAncia e Tecnologia de Almada/Set=FAbal . Edif=EDcio Mada= n 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 ha= ve >> > received this email in error and that any use, dissemination, forwardi= ng, >> > printing, or copying of this email is strictly prohibited. If you have >> > received this email in error please notify Bruno Ren=E9 Santos by tele= phone >> on >> > +351 210 438 686 >> > >> >> > > > -- > Bruno Ren=E9 Santos | brunorene@holos.pt | Gestor de Projectos | Analista= | > Programador | Investigador > > Holos - Solu=E7=F5es Avan=E7adas em Tecnologias de Informa=E7=E3o S.A. > Parque de Ci=EAncia e Tecnologia de Almada/Set=FAbal . Edif=EDcio Madan P= arque > 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 intende= d > 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=E9 Santos by telepho= ne on > +351 210 438 686 >