cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aristedes Maniatis <>
Subject Re: Best Practices Question
Date Wed, 22 Apr 2009 00:32:23 GMT

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  
> worry about data caching in different DataContexts?

I'd like to add just one further point. It is a common design pattern  
to create one read-only 'shared' context which is used to fetch and  
display information. This shared context lives for the life of the  
application. Then when users 'go into edit mode' whatever that means  
for your application, you create a new context for them and manage  
their changes until they save in that dedicated context.

You need to be careful because you cannot relate two objects in  
different contexts, but it isn't hard to copy objects from one context  
to another.

There is nothing in Cayenne which enforces a context read-only or  
'shared', it is just the manner in which you use it.


Level 1, 30 Wilson Street Newtown 2042 Australia
phone +61 2 9550 5001   fax +61 2 9550 4001
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A

View raw message