Re: Cayenne and WebServices

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

  • Next message: Cris Daniluk: "List modification"

    > We are starting a Cayenne based project using Apache Axis based web
    > services. We have an existing WebObjects based application using EOF and are
    > using this project as a test to see if we can replace EOF with Cayenne on a
    > larger scale in our applications.
    >
    Good choice :)

    > For a web service what is the best way to use/reuse a DataContext so we can
    > scale our app to handle lots of concurrent users/connections to our web
    > services. Some of our web services will be read only type of services,
    > others will be used to modify or create data. In EOF we have used
    > SharedEditingContexts with some success.
    >
    > Is it better to use the ThreadedDataContext or is it safe to reuse or share
    > DataContexts across multiple users in a stateless environment like a web
    > service?
    >

    Reusing DataContexts in a stateless environment is a risky proposition
    because of caching, dirty objects, synchronization, etc. You certainly
    can do it, but have to be careful. I would tend to think that just
    creating a DataContext each request and tearing it down would be fine.
    You can still use shared JVM caching for performance tuning, after
    all.

    Best bet is to profile it a bit under your expected load. Odds are
    Axis is going to suck so much that you'll never get to a point where
    the DataContext is the problem :)

    Cris



    This archive was generated by hypermail 2.0.0 : Tue Jan 10 2006 - 22:14:23 EST