RE: accessing cayenne sessions

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Tue Apr 04 2006 - 10:15:25 EDT

  • Next message: Mike Kienenberger: "Re: [solved] Re: Cayenne.xml not found."

    First off, which version of Tapestry are you using? And what version of
    Java?

    I've used Cayenne with Tapestry 3 and 4 and store my Cayenne DataContext
    in the session. The session handling has changed a bit between T3 and
    T4, though (at least if you don't want deprecation warnings littering
    your code), but the concept still works. For example, one of my
    listener methods (on an "Update" button) does:

    public void update()
    {
      getSession().getDataContext().commitChanges();
    }

    In WebObjects it would've been
    session().defaultEditingContext().saveChanges().

    I've not used JBoss for development, though. I develop using Jetty and
    deploy on Tomcat.

    I'm not super-knowledgeable on Hibernate, but Cayenne is much more
    EOF-like. If you like what EOF does for the most part, Cayenne is a
    good choice.

    /dev/mrg

    -----Original Message-----
    From: Cyp her [mailto:cypher6..otmail.com]
    Sent: Tuesday, April 04, 2006 9:52 AM
    To: cayenne-use..ncubator.apache.org
    Subject: accessing cayenne sessions

    Hi

    I am a newbie to Cayenne but I have been developing with WebObjects for
    a
    few years and though I would try something open source. I have been
    reading
    a few articles on getting the DataContext namely this one
    http://www.objectstyle.org/confluence/display/CAYDOC/Web+Applications
    but it
    still leaves me a little bit confused.

    My set up is Cayenne with Tapestry deployed to JBoss using Eclipse as
    the
    development platform. So my questions are

    * 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?

    * Can I do the same using Tapestry to achieve the same results i.e. are
    there any Tapestry calls for getting the Session

    * Are there any convenient methods for accessing the Session like in
    WebObjects where there is a session class in the application?

    * 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?

    Thank you very much for your help and apologies if all the answersw are
    somewhere in this mailing list.

    Lawrence

    _________________________________________________________________
    Are you using the latest version of MSN Messenger? Download MSN
    Messenger
    7.5 today! http://join.msn.com/messenger/overview



    This archive was generated by hypermail 2.0.0 : Tue Apr 04 2006 - 10:15:50 EDT