Expand my Community achievements bar.

SOLVED

Calling session.save(), etc. on a parent node vs. a node itself

Avatar

Level 7

Hi,

In /libs/foundation/src/impl/src/main/java/com/day/cq/wcm/foundation/forms/impl/FormParagraphPostProcessor.java, the checkFormStructure method, there are a few method invokations that are similar to this:

  • parent.getSession().save();
  • if ( parent.getSession().hasPendingChanges() ) { parent.getSession().refresh(false); }

What is the difference between calling getSession().save(), getSession().hasPendingChanges(), and getSession().refresh(false) on a node vs its parent?

Thanks in advance.

1 Accepted Solution

Avatar

Correct answer by
Employee

I can't find checkFormStructure anymore in AEM6, but in general there is no difference between the session of the parent or child node if there are retrieved by the same resource-resolver/session.

Another way to save changes is via the resource-resolver, have a look at this article:

http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2013/03/changing-resources-in-cq56...

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

I can't find checkFormStructure anymore in AEM6, but in general there is no difference between the session of the parent or child node if there are retrieved by the same resource-resolver/session.

Another way to save changes is via the resource-resolver, have a look at this article:

http://experiencedelivers.adobe.com/cemblog/en/experiencedelivers/2013/03/changing-resources-in-cq56...