Re: Cayenne, Tapestry and DataContext

From: Oscar Picasso (oscgoogl..ahoo.com)
Date: Sat Nov 05 2005 - 15:32:09 EST

  • Next message: Borut Bolčin: "Re: Cayenne, Tapestry and DataContext"

    > I am also learning Cayenne and Tapestry 4 at the moment. The application
    > I am currently on has one DataContext in my ASO application scope class.

    What is an ASO application?

    > I am not sure what you mean by DataContext growth by retrieving from it.
    > I guess growth can be controlled.

    Lets's say I have
    Person
    {
      Person mam;
      Person dad;
      List<Person> children;
    }

    // Actually execute some query with the data context.
    Person albert = dao.findByName("Albert")

    At this point, my understanding is that albert.children are not in memory.
    Then if i do something like:

    for(Person child: children)
    {
      do somthing with child;
    }

    The children are loaded in memory, if I keep looking for the children of the
    children and so on, each time more persons are loaded in memory.

    Am I right?

    If that the case, for some big potential graphs, at some point you end up with
    thousands or millions of Objects/Persons in memory if you use the same
    DataContext.

    I don't know how Cayenne deals with this situation. Does it discard the least
    recently used Objects, does it perform some kind of caching, or do we need to
    keep track of the Object creation to avoid a potential OutOfMemoryException.

    Oscar

                    
    __________________________________
    Yahoo! FareChase: Search multiple travel sites in one click.
    http://farechase.yahoo.com



    This archive was generated by hypermail 2.0.0 : Sat Nov 05 2005 - 15:32:09 EST