Re: Managing Result Sets

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Nov 18 2009 - 10:01:26 EST

  • Next message: Joe Baldwin: "Re: Managing Result Sets"

    On Nov 18, 2009, at 4:51 PM, Sales Manager wrote:

    > I have a question concerning the rules associated with the standard
    > algorithm that controls the release of Cayenne data objects.
    >
    > 1. Lets say we do a select query and a result set list of 100 data
    > objects is returned.
    > 2. Only one of those data object is needed by the app and an app-
    > level container keeps a reference to that one data object.
    > 3. The reference to the result set is set to null.
    >
    > Question:
    >
    > Will the entire list (excluding the one referenced data object) be
    > garbage collected, or will the entire result set be retained?
    >
    > (I assume that it is the former, I just want to make sure that I
    > have not missed some step that I am responsible for.)
    >
    > Thanks,
    > Joe

    The former is true in Cayenne 3.0, the later is true in Cayenne 2.0
    and earlier. (I.e. in 2.0 the list itself will be garbage collected
    but its objects will still be sitting in the DataContext).

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Nov 18 2009 - 10:02:05 EST