cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: accessing cayenne sessions
Date Tue, 04 Apr 2006 14:53:21 GMT

On Apr 4, 2006, at 5:52 PM, Cyp her wrote:

> * What is the best way of retrieving the session context  
> (DataContext) on a given page and tracking the changes over a  
> workflow and eventually committing the changes or discarding them?

Cayenne 1.2 has a WebApplicationContextFilter:

http://objectstyle.org/confluence/display/CAYDOC/Servlet+2.3+Filter

It provides you access to the session DataContext regardless of the  
framework you use (in the past I put it in Tapestry Visit instead,  
but I don't bother anymore, the filter is more portable). If you  
configure the filter per docs page above, you can always get the  
session context anywhere in the app like this:

DataContext context = DataContext.getThreadDataContext();


> * I have read some people opt to use Tapestry, Spring and  
> Hibernate. What are the advantages if there are any and can you use  
> Tapestry, Spring and Cayenne?

Yeah, that's the right place to ask for an unbiased Cayenne vs.  
Hibernate comparison ;-)

Hibernate is an ORM, so conceptually it is similar to Cayenne (and  
EOF). Regarding the differences... Cayenne provides more EOF-like  
experience in managing your object graph. I've heard an opinion from  
a WO user that Hibernate is more like eoaccess (I guess he was  
referring to the fact that you need to manage a number of low-level  
details). In this respect Cayenne is eoaccess+eocontrol (and since  
recently - also EO JavaClient, for those who care). DataContext is  
very similar to EOEditingContext.

IMO when migrating from WO, switching from EOF to Cayenne is a  
relatively minor thing compared to switching WO framework to any  
other web front-end technology.

Andrus







Mime
View raw message