cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrus Adamchik <and...@objectstyle.org>
Subject Re: Managing Result Sets
Date Wed, 18 Nov 2009 15:01:26 GMT

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


Mime
View raw message