Return-Path: Delivered-To: apmail-cayenne-user-archive@www.apache.org Received: (qmail 10207 invoked from network); 4 May 2009 22:34:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 4 May 2009 22:34:28 -0000 Received: (qmail 86771 invoked by uid 500); 4 May 2009 22:34:28 -0000 Delivered-To: apmail-cayenne-user-archive@cayenne.apache.org Received: (qmail 86733 invoked by uid 500); 4 May 2009 22:34:28 -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 86715 invoked by uid 99); 4 May 2009 22:34:27 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 22:34:27 +0000 X-ASF-Spam-Status: No, hits=-1.0 required=10.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [202.53.198.245] (HELO bslsydmims01.csc.net.au) (202.53.198.245) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 04 May 2009 22:34:15 +0000 X-IronPort-AV: E=Sophos;i="4.40,293,1238940000"; d="scan'208";a="37883891" Received: from unknown (HELO stlsydxbh02.steel.bhpsteel.net) ([20.254.251.9]) by bslsydmims01.csc.net.au with ESMTP; 05 May 2009 08:29:39 +1000 Received: from stlaklxch01.nzsakl.bhp.com.au ([152.153.244.5]) by stlsydxbh02.steel.bhpsteel.net with Microsoft SMTPSVC(6.0.3790.1830); Tue, 5 May 2009 08:33:51 +1000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: Best Practices Question Date: Tue, 5 May 2009 10:33:51 +1200 Message-ID: <48113F1FB29BB14FA94459FADFDA97D22514B1@stlaklxch01.nzsakl.bhp.com.au> In-Reply-To: <0F8D1F5A-E312-4AA0-B295-2A8F68C24304@ish.com.au> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Best Practices Question Thread-Index: AcnC4ep9uS4fL2ETROGLH3TjdGkH+gKJkwsg References: <32418B2B-97B7-44D0-88D3-25F092E24508@gmail.com> <5adb61290904210626k1d19b92di2e09d2f571e5c1e3@mail.gmail.com> <3FDD3380-3B9C-4BC9-9ECE-AC0871D62223@gmail.com> <6FA98945-D42F-489B-B2A1-A0EA9BB056A7@roxanemy.com> <0F8D1F5A-E312-4AA0-B295-2A8F68C24304@ish.com.au> From: "Weddle, Anthony" To: X-OriginalArrivalTime: 04 May 2009 22:33:51.0558 (UTC) FILETIME=[663E9660:01C9CD08] X-Virus-Checked: Checked by ClamAV on apache.org Wouldn't it be better to use a nested context for "edit mode"? Once committed, those changes would be visible in the shared context. Tony -----Original Message----- From: Aristedes Maniatis [mailto:ari@ish.com.au]=20 Sent: Wednesday, 22 April 2009 12:32 p.m. To: user@cayenne.apache.org Subject: Re: Best Practices Question On 22/04/2009, at 6:40 AM, Ylan Segal wrote: > In a web app where each session has a DataContext, do I need to =20 > worry about data caching in different DataContexts? I'd like to add just one further point. It is a common design pattern =20 to create one read-only 'shared' context which is used to fetch and =20 display information. This shared context lives for the life of the =20 application. Then when users 'go into edit mode' whatever that means =20 for your application, you create a new context for them and manage =20 their changes until they save in that dedicated context. You need to be careful because you cannot relate two objects in =20 different contexts, but it isn't hard to copy objects from one context =20 to another. There is nothing in Cayenne which enforces a context read-only or =20 'shared', it is just the manner in which you use it. Regards Ari