> On Jun 8, 2004, at 11:40 AM, Marko Kocic wrote:
>
> > No, I don't put DataContext in session/visit, I just fetch it for each
> > service method invocation (see interceptor bellow).
>
> This may have undesirable side effects. If you want to work with object
> relationships, related objects must be registered with the same
> DataContext. Of course you can fetch all needed objects on every
> request, but this seems wasteful. The most efficient use of Cayenne in
> a web app is when a DataContext spans the whole session.
Thanx for insight. I just wanted to use DataContext the same way I used
Connection,
fetch it from DataSource when I need it, use it, and close when I don't need
it
anymore.
Sure I want to use relationships. So you suggest I should have one
DataContext
per user for performance reasons? What if I have say 500 logged in users?
Does
each DataContext maintain its own object cache, or cache is shared between
contexts?
I'm concerned about memory.
I'm still playing with Cayenne, so IMHO something like "best practices" info
would be
great.
btw [off topic]
Cayenne is a great framework (at least what I found so far). Modeler is what
bought me to
Cayenne :). But it stll has some (non technical) issues where it is far
behind hibernate. Just
look at the hibernate site, it's full of examples and tutorials (h +
spring, h + webwork,
h + tapestry, h + struts, h + BMP beans, h + jboss...).
Something like that would be great for Cayenne too.
> Andrus
Regards, Marko
This archive was generated by hypermail 2.0.0 : Wed Jun 09 2004 - 02:43:21 EDT