Calling session.save(), etc. on a parent node vs. a node itself | Community
Skip to main content
LinearGradient
Level 6
October 16, 2015
Solved

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

  • October 16, 2015
  • 1 reply
  • 700 views

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.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Feike_Visser1

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.html

1 reply

Feike_Visser1
Adobe Employee
Feike_Visser1Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

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.html