You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by "Robert A. Decker" <de...@robdecker.com> on 2012/08/02 02:02:40 UTC

unsaved changes?

Hi,

We have a situation that comes up in our system infrequently where a node is garbage collected which has unsaved changes. (we have a check in the finalize method of a Resource subclass). 

When we look in the repository the node actually does exist and the values are what we expect them to be. Is it possible to see what the unsaved changes are programmatically?

(if not, we could just print out all of the properties of the node that has unsaved changes to the logs and then browse the repo with the sling explorer, but I'm wondering if there's a way to do it programmatically.)

Rob

Re: unsaved changes?

Posted by Felix Meschberger <fm...@adobe.com>.
Hi,

Am 02.08.2012 um 02:02 schrieb Robert A. Decker:

> Hi,
> 
> We have a situation that comes up in our system infrequently where a node is garbage collected which has unsaved changes. (we have a check in the finalize method of a Resource subclass). 
> 
> When we look in the repository the node actually does exist and the values are what we expect them to be. Is it possible to see what the unsaved changes are programmatically?
> 
> (if not, we could just print out all of the properties of the node that has unsaved changes to the logs and then browse the repo with the sling explorer, but I'm wondering if there's a way to do it programmatically.)

I am not aware of a method like Session.getModifiedItems() as a add-on to Session.hasPendingChanges(). 

On the other hand there are the Item.isNew() and Item.isModified() methods which indicate whether an Item (Node or Property) has just been created or modified but not saved yet.

Regards
Felix

Re: unsaved changes?

Posted by "Robert A. Decker" <de...@robdecker.com>.
Yes, I'm closing the resourceResolver after we're done using it in some of our event job processors. I want it to be garbage collected fairly quickly since we're firing off many thousands of events/jobs in a short amount of time.

Rob

On Aug 2, 2012, at 2:24 AM, Carsten Ziegeler wrote:

> Hi,
> 
> I would assume that the corresponding session has a reference to all
> changed nodes - so unless you're closing the session, the node obj
> should not be garbage collected.
> 
> Regards
> Carsten
> 
> 2012/8/2 Robert A. Decker <de...@robdecker.com>:
>> Hi,
>> 
>> We have a situation that comes up in our system infrequently where a node is garbage collected which has unsaved changes. (we have a check in the finalize method of a Resource subclass).
>> 
>> When we look in the repository the node actually does exist and the values are what we expect them to be. Is it possible to see what the unsaved changes are programmatically?
>> 
>> (if not, we could just print out all of the properties of the node that has unsaved changes to the logs and then browse the repo with the sling explorer, but I'm wondering if there's a way to do it programmatically.)
>> 
>> Rob
> 
> 
> 
> -- 
> Carsten Ziegeler
> cziegeler@apache.org
> 


Re: unsaved changes?

Posted by Carsten Ziegeler <cz...@apache.org>.
Hi,

I would assume that the corresponding session has a reference to all
changed nodes - so unless you're closing the session, the node obj
should not be garbage collected.

Regards
Carsten

2012/8/2 Robert A. Decker <de...@robdecker.com>:
> Hi,
>
> We have a situation that comes up in our system infrequently where a node is garbage collected which has unsaved changes. (we have a check in the finalize method of a Resource subclass).
>
> When we look in the repository the node actually does exist and the values are what we expect them to be. Is it possible to see what the unsaved changes are programmatically?
>
> (if not, we could just print out all of the properties of the node that has unsaved changes to the logs and then browse the repo with the sling explorer, but I'm wondering if there's a way to do it programmatically.)
>
> Rob



-- 
Carsten Ziegeler
cziegeler@apache.org