Return-Path: Delivered-To: apmail-incubator-cayenne-user-archive@locus.apache.org Received: (qmail 37353 invoked from network); 13 Apr 2006 06:23:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Apr 2006 06:23:04 -0000 Received: (qmail 37439 invoked by uid 500); 13 Apr 2006 06:23:01 -0000 Delivered-To: apmail-incubator-cayenne-user-archive@incubator.apache.org Received: (qmail 37419 invoked by uid 500); 13 Apr 2006 06:23:01 -0000 Mailing-List: contact cayenne-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cayenne-user@incubator.apache.org Delivered-To: mailing list cayenne-user@incubator.apache.org Received: (qmail 37410 invoked by uid 99); 13 Apr 2006 06:23:01 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 12 Apr 2006 23:23:01 -0700 X-ASF-Spam-Status: No, hits=0.8 required=10.0 tests=INFO_TLD X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [64.124.179.114] (HELO mensk.objectstyle.org) (64.124.179.114) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 12 Apr 2006 23:23:00 -0700 Received: (qmail 1505 invoked from network); 13 Apr 2006 06:22:39 -0000 Received: from localhost (HELO ?IPv6:::1?) (127.0.0.1) by mensk.objectstyle.org with SMTP; 13 Apr 2006 06:22:39 -0000 Mime-Version: 1.0 (Apple Message framework v746.3) In-Reply-To: <1A54321E-9DA6-4DAD-BC0B-3698CB5F9C63@ish.com.au> References: <7D2E4DAC-09D6-42BF-B407-DBC02BA977EA@ish.com.au> <62995D76-14BA-41F7-BB69-3EAA2D4B40D2@pvv.ntnu.no> <014C6AC1-DE9F-482B-AADD-2FA93F069E0E@ish.com.au> <9668E223-9057-497D-ACA0-215F775CBD0A@pvv.ntnu.no> <89219196-239A-4BB7-AF7B-E060C01E7FEE@ish.com.au> <30AC9F29-9F86-4636-9123-903DE4F7B0D7@objectstyle.org> <1A54321E-9DA6-4DAD-BC0B-3698CB5F9C63@ish.com.au> Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Andrus Adamchik Subject: Re: toMany relationship not fetched Date: Thu, 13 Apr 2006 10:22:38 +0400 To: cayenne-user@incubator.apache.org X-Mailer: Apple Mail (2.746.3) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Marcin, I'll look into that. Just to clarify, what version of Cayenne are you using? Is this the latest nightly build? Andrus On Apr 13, 2006, at 7:39 AM, Marcin Skladaniec wrote: > Hello everyone ! > > Andrus, thank you for fixing that bug so quickly ! > > > I got another problem, it may be related to previous thats why I > post it here. > > It does not happen always, I tried to create a separate project to > reproduce it, but I couldn't. > > This is the code which reproduces problem in my application: > > CayenneContext context = ContextManager.getNewDedicatedContext(); > List students = context.performQuery(new SelectQuery > (Student.class)); > for (int i=0 ; i Student student = (Student)students.get(i); > > //this works ... > logger.info(i+ ") students count = " +student.getLanguage > ().getStudents().size()); > > //this don't work > logger.info(i+ ") language name = " +student.getLanguage > ().getName()); > } > > CayenneContext context2 = ContextManager.getNewDedicatedContext(); > List languages = context2.performQuery(new SelectQuery > (Language.class)); > for (int i=0 ; i< languages.size();i++) { > Language language = (Language)languages.get(i); > if (language.getStudents().size() > 0) { > > logger.info(i+ ") language name = " +language.getName()); > logger.info(i+ ") students count = " +language.getStudents > ().size()); > > for (int j =0;j Student student = ((Student)language.getStudents().get(j)); > logger.info("\t"+j+ ") student name = " +student.getFullName > ()); > logger.info("\t"+j+ ") student language = " > +student.getLanguage().getName()); > > } > } > } > > On output I'm getting : > > - 0) students count = 1 > - 0) language name = null > - 1) students count = 1 > - 1) language name = null > - 2) students count = 1 > - 2) language name = null > > - 8) language name = Galic > - 8) students count = 1 > - 0) student name = test test > - 0) student language = Galic > - 1287) language name = Guatamalan > - 1287) students count = 1 > - 0) student name = test2 test2 > - 0) student language = Guatamalan > - 1509) language name = English > - 1509) students count = 1 > - 0) student name = test3 test3 > - 0) student language = English > > It looks like sometimes the object is not "faulted" correctly. I > can't see when and why ... > > > Marcin > > > On 11/04/2006, at 5:35 PM, Andrus Adamchik wrote: > >> Ok, now I got it. This is a bug - RelationshipQuery was >> incorrectly intercepted by the client CayenneContext. I opened a >> bug report: >> >> http://objectstyle.org/jira/browse/CAY-500 >> >> and actually already checked in the fix, so it should be available >> in 04/11 nightly build. >> >> Thanks >> Andrus >> >> >> On Apr 11, 2006, at 4:58 AM, Marcin Skladaniec wrote: >> >> > > --------------------------> > ish > http://www.ish.com.au > Level 1, 30 Wilson Street Newtown 2042 Australia > phone +61 2 9550 5001 fax +61 2 9550 4001 > > >