My Cayenne usage with Tapestry applications involves:

1) Putting a Cayenne DataContext in my Visit object (I run stateful)
2) Grab the DataContext object (if needed) from the Visit object in my
pages
3) Do anything I need (or just use objects already fetched)

The DataContext is pretty central to using Cayenne (similar to an
EOEditingContext if you are familiar with EOF).  It tracks changes to
objects, figures out the INSERT/UPDATE/DELETE operations required,
handles optimistic locking, etc.  All of your persisted objects are
tracked/managed in a DataContext (and yes, you can create more than one
if needed).

Cayenne handles the faults (lazy in Hibernate, from what I can tell)
just fine, even across different request/response loops.  I don't
believe Cayenne has a problem with a user accidentally clicking on a
submit button twice, either.  Cayenne is aware of changes to the object
graph and the second click will result in Cayenne not doing anything
since the graph is up-to-date (assuming you aren't inserting new
objects/etc at the time of the click -- probably better to do this when
you initially render the page -- create your new objects without
committing when you render the page and use the submit to commit them).
Deletes might require a bit more care.

I'm not sure how easy it is to migrate from one to the other.  Cayenne
doesn't use POJOs (at least not yet), but I actually like this.
Everything you persist inherits from CayenneDataObject, which provides a
lot of common functionality and consistency.  Cayenne Modeler can
extract your schema from an existing DB, but there isn't a tool (that I
know of) to take Hibernate files and make Cayenne files out of them.
Maybe we should write one?  :-)

So, in summary, it has Just Worked so far for me.  I just stick the
DataContext in the Visit and let Tapestry and Cayenne do their thing.

/dev/mrg


-----Original Message-----
From: Chris Chiappone [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 18, 2005 10:09 AM
To: Tapestry users
Subject: Re: Back to Tapestry after an Year


How is Cayenne with dealing with session and transaction issues and
lazy initialization problem?.  Thats what I seem to have the most
difficulty with.  Currently I seem to have to use lazy="false" with
all my persistant objects.  Would you say that it is easy to migrate
from hibernate to cayenne?

On 8/18/05, Eric Schneider <[EMAIL PROTECTED]> wrote:
> I can offer a few reasons why I like it better.
> 
> It's based on another excellent O/R framework (EOF, the O/R framework
> bundled with WebObjects).
> 
> I think it's easier to learn, the naming is less awkward, and the
> Cayenne mailing list is more helpful than the Hibernate forums.
> 
> Cayenne dynamically will fault relationships when needed.   When
> using Hibernate I felt like you have to think a lot more about the
> presentation of specific pages while writing low level code.  If you
> haven't pre-fetched every single thing you need to paint a page,
> Hibernate will throw attempting to traverse the object graph (because
> your Hibernate session is long closed).
> 
> I think most importantly, the Cayenne modeler is so far superior to
> Hibernate tools (middlegen, hbm2java) they just cannot be compared.
> I couldn't even quantify how much time and effort this tool has saved
> me.
> 
> Again, this is only my opinion.   But, I'm probably one of few people
> that have used both frameworks on large projects.  You mileage my
vary.
> 
> Cheers,
> Eric
> 
> On Aug 17, 2005, at 5:12 PM, Konstantin Ignatyev wrote:
> 
> > Could you share what exactly makes you to consider
> > Cayene being better tnan Hibernate?
> >
> >
> > --- James Treleaven <[EMAIL PROTECTED]> wrote:
> >
> >
> >> I also recommend that people who have not yet
> >> invested in Hibernate try
> >> Cayenne.  I actually bought 'Hibernate in Action'
> >> because I figured
> >> Hibernate *must* have had some advantage over
> >> Cayenne that I didn't know
> >> about - but after reading 'Hibernate in Action' I
> >> remain convinced that
> >> Cayenne is the superior ORM tool.
> >>
> >> James
> >>
> >>
> >>
> >>
> >
---------------------------------------------------------------------
> >
> >> To unsubscribe, e-mail:
> >> [EMAIL PROTECTED]
> >> For additional commands, e-mail:
> >> [EMAIL PROTECTED]
> >>
> >>
> >>
> >
> >
> > Konstantin Ignatyev
> >
> >
> >
> >
> > PS: If this is a typical day on planet earth, humans will add
> > fifteen million tons of carbon to the atmosphere, destroy 115
> > square miles of tropical rainforest, create seventy-two miles of
> > desert, eliminate between forty to one hundred species, erode
> > seventy-one million tons of topsoil, add 2,700 tons of CFCs to the
> > stratosphere, and increase their population by 263,000
> >
> > Bowers, C.A.  The Culture of Denial:  Why the Environmental
> > Movement Needs a Strategy for Reforming Universities and Public
> > Schools.  New York:  State University of New York Press, 1997: (4)
> > (5) (p.206)
> >
> >
---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail:
[EMAIL PROTECTED]
> >
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 


-- 
~chris

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to