Re: Cayenne and WebServices

From: Cris Daniluk (cris.danilu..mail.com)
Date: Tue Jan 10 2006 - 22:35:55 EST

  • Next message: Andrus Adamchik: "Re: Cayenne and WebServices"

    > Our biggest goal with Cayenne is to take advantage of the connection pooling
    > and some of the caching. I think if we can keep up with Axis I will be very
    > happy.
    >
    JVM ("Shared") caching will happen regardless of what DataContext
    strategy you select, as will pooling.

    > What about the difference between Thread bound datacontext and session bound
    > data context? Which would be more appropriate for a stateless web service

    I think that is an apples and oranges question. How stateless are we
    talking about? If there is a concept of a user session, where a "user"
    (be it a script or otherwise) authenticates and performs a series of
    related service requests, then you could maintain some sort of session
    object for each "user", ala an HttpSession. Then, you could bind that
    DataContext to the thread each time a user makes a request. This
    mimics the standard web behavior very closely, and in fact if you were
    to use some of the Axis WS-* stuff, you could probably do it directly
    out of an HttpSession, using the filter Cayenne provides..

    Now, if its truely stateless - where each request can be assumed to
    have little in common with the previous, then I would personally think
    creating a new DataContext for each request is the way to go. Since
    the DataContexts aren't really threadsafe anyway, it probably doesn't
    make sense to do it any other way.

    As I mentioned before, it sounds like Cayenne will provide the big
    things you're after regardless of the DataContext re-use strategy you
    go with.

    Cris



    This archive was generated by hypermail 2.0.0 : Tue Jan 10 2006 - 22:35:56 EST