Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 10040 invoked from network); 13 Jan 2009 05:30:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Jan 2009 05:30:45 -0000 Received: (qmail 35346 invoked by uid 500); 13 Jan 2009 05:30:44 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 35332 invoked by uid 500); 13 Jan 2009 05:30:44 -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 35321 invoked by uid 99); 13 Jan 2009 05:30:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jan 2009 21:30:44 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of marcin@ish.com.au designates 59.167.240.32 as permitted sender) Received: from [59.167.240.32] (HELO fish.ish.com.au) (59.167.240.32) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 13 Jan 2009 05:30:35 +0000 Received: from ip-211.ish.com.au ([203.29.62.211]:61646 helo=ish.com.au) by fish.ish.com.au with esmtp (Exim 4.69) (envelope-from ) id 1LMcS2-0004Qk-0D for user@cayenne.apache.org; Tue, 13 Jan 2009 17:08:34 +1100 Received: from [123.211.145.27] (account marcin@ish.com.au) by ish.com.au (CommuniGate Pro WEBUSER 5.2.11) with HTTP id 4351896 for user@cayenne.apache.org; Tue, 13 Jan 2009 16:30:04 +1100 From: "Marcin Skladaniec" Subject: nested contexts To: user@cayenne.apache.org X-Mailer: CommuniGate Pro WebUser v5.2.11 Date: Tue, 13 Jan 2009 15:30:04 +1000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1;format="flowed" Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org Hi I have tried to use the nested contexts today. I tried a very simple thing, creating two objects one in the parent one in the child context, then linking them together: ObjectContext aContext = ContextManager.getNewContext(); ObjectContext childContext = aContext.createChildContext(); Site site = aContext.newObject(Site.class); Room room = childContext.newObject(Room.class); r.setSite(s); the last line throws exception: [java] org.apache.cayenne.CayenneRuntimeException: [v.3.0-SNAPSHOT ${project.build.date} ${project.build.time}] Cannot set object as destination of relationship site because it is in a different ObjectContext [java] at org.apache.cayenne.CayenneDataObject.willConnect(CayenneDataObject.java:338) [java] at org.apache.cayenne.CayenneDataObject.setToOneTarget(CayenneDataObject.java:292) [java] at ish.oncourse.server.cayenne.glue._Room.setSite(_Room.java:135) ...rest of stack trace is not important I think it is a bug, and relating objects should be allowed between parent/child contexts. Another thing is that the http://cayenne.apache.org/doc/nested-datacontexts.html states that nested contexts are not available in ROP, is that still? All best Marcin