Re: commit all objects, temporary objects, POJO's, DTO

2011-04-27 Thread Michael Gentry
Hi Felix, I use DataContexts to group related changes. If I need to do an unrelated change, I create a new (or child) DataContext, do my change in it, and commit it. You don't have to stick to just one DataContext. Create as many as you need. mrg On Wed, Apr 27, 2011 at 8:36 AM, felix wrote

Re: commit all objects, temporary objects, POJO's, DTO

2011-04-27 Thread Mike Kienenberger
You're going to have to give us more information before we can speculate on what's the best choice. It may be that a combination of several approaches make sense for your current project. I've used a number of approaches in the past. For example. On one struts project, I created a per-ses

Re: commit all objects, temporary objects, POJO's, DTO

2011-04-27 Thread felix
Thanks for your quick response. It seems like we have two options: - Create a context per writeable action (otherwise we could not retrieve an object, updated and save exactly when we want, in other words, when the obj is in a consistent state) - Create a DTO layer and have for instance one conte

Re: commit all objects, temporary objects, POJO's, DTO

2011-04-27 Thread Mike Kienenberger
The thing to remember is that Cayenne DataContexts are completely under your control. There are convenience classes to automatically make one data context managed per session, but that's only one of many ways, not only way or even the recommended way. It's hard to help without more specific info

commit all objects, temporary objects, POJO's, DTO

2011-04-27 Thread felix
I am using Cayenne with Wicket, and am using the servlet filter described here http://cayenne.apache.org/doc30/web-applications.html to bind a DataContext to requests. I understand this occurs per session, so subsequent requests within the session are associated to the same DataContext, which is