Return-Path: Delivered-To: apmail-db-ojb-dev-archive@www.apache.org Received: (qmail 79958 invoked from network); 28 Jul 2004 09:01:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 28 Jul 2004 09:01:32 -0000 Received: (qmail 40972 invoked by uid 500); 28 Jul 2004 09:01:31 -0000 Delivered-To: apmail-db-ojb-dev-archive@db.apache.org Received: (qmail 40933 invoked by uid 500); 28 Jul 2004 09:01:30 -0000 Mailing-List: contact ojb-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "OJB Developers List" Reply-To: "OJB Developers List" Delivered-To: mailing list ojb-dev@db.apache.org Received: (qmail 40918 invoked by uid 99); 28 Jul 2004 09:01:30 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FORGED_RCVD_HELO X-Spam-Check-By: apache.org Received: from [217.160.181.179] (HELO p15124607.pureserver.info) (217.160.181.179) by apache.org (qpsmtpd/0.27.1) with ESMTP; Wed, 28 Jul 2004 02:01:28 -0700 Received: from localhost (localhost.localdomain [127.0.0.1]) by localhost (Postfix) with ESMTP id B1F01178087 for ; Wed, 28 Jul 2004 11:01:21 +0200 (CEST) Received: from tvc-software.com (pD9EAA7A9.dip.t-dialin.net [217.234.167.169]) by p15124607.pureserver.info (Postfix) with ESMTP id A8A8D178057 for ; Wed, 28 Jul 2004 11:01:18 +0200 (CEST) X-AuthUser: tomahawk@tvc-software.com Received: from [192.168.0.2] (192.168.0.2:1570) by tvc-software.com (192.168.0.1:25) with [XMail 1.17 (Linux/Ix86) ESMTP Server] id for from ; Wed, 28 Jul 2004 11:01:17 +0200 Message-ID: <41076B5B.1040802@TVCS.de> Date: Wed, 28 Jul 2004 11:01:15 +0200 From: Thomas Vogt User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.7) Gecko/20040616 X-Accept-Language: de-de, de-at, de, en-us, en MIME-Version: 1.0 To: OJB Developers List Subject: Re: OJB Foreign Key Problem in Persistence Broker (MySQL InnoDB) References: <6FB083FB72EFD21181D30004AC4CA18A0324A9BF@SRV002> <41052831.4020702@atlas.cz> <41052A8E.6010709@first.fhg.de> <4106143D.2010206@atlas.cz> <41061E54.3010802@atlas.cz> <410621C3.8040505@first.fhg.de> <4106330E.3040501@atlas.cz> <41074F0A.70703@first.fhg.de> <41075E23.3010609@TVCS.de> <41076225.80201@first.fhg.de> In-Reply-To: <41076225.80201@first.fhg.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-DCC: : X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on p15124607.pureserver.info X-Spam-Level: X-Spam-Status: No, hits=-98.6 required=5.0 tests=BAYES_00,RCVD_IN_DYNABLOCK, RCVD_IN_NJABL,RCVD_IN_NJABL_DIALUP,RCVD_IN_SORBS,USER_IN_WHITELIST autolearn=no version=2.63 X-Virus-Scanned: by AMaViS 0.3.12 X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Thomas Dudziak schrieb: > Thomas Vogt wrote: > >> I'm using the Persistence Broker to access the data in an MySQL InnoDB >> Database, when the Primary Key is not in the same order as the foreign >> ky constraint is, OJB seems to erranously mix it up and tries the wrong >> way round, this way it won't find a result. >> >> OJB only does so in foreign keys, when the object itself is searched >> directly, it is found without any problem. >> >> I tried to solve the problem on my own, but i did not find the >> problematic part in the source, so could someone with more detail >> knowledge try to identify and fix the problem ? > > > Why is that a problem ? You could simply change the order of primary > keys in the class descriptor so that your pk actually matches the fk. > This does not affect the field order in your class nor the column > order in the database. > Thats what I did, without result, but half an hour ago I found out the problem is in repository_user.xml The order of the foreign key fields here, seems to be mandatory, OJB just takes the order as is, and attaches the values it gets. By switching the order here, I solved the problem. But there needs to be some kind of fix in thios place because it took me abour 1 day to get there, and only after activating all possible debug logs I found that the key order in the search is not the way it should be. OJB should check where it puts which value in a select statement (compare columnnames). Thanks Thomas > Tom > > --------------------------------------------------------------------- > To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org > For additional commands, e-mail: ojb-dev-help@db.apache.org > > > --------------------------------------------------------------------- To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org For additional commands, e-mail: ojb-dev-help@db.apache.org