Leiste mit Community-Erfolgen erweitern.

Submissions are now open for the 2026 Adobe Experience Maker Awards.

Mark Solution

Diese Konversation wurde aufgrund von Inaktivität geschlossen. Bitte erstellen Sie einen neuen Post.

GELÖST

do a session.save() every 1000 nodes?

Avatar

Level 2

Hello,

We have a custom cron job creating thousands of blueprint pages and rolling out to live copies in one session. We are not sure about the best practice of how often to save the session. Found this nice article AEM transaction size or “do a save every 1000 nodes” | Things on a content management system and seems it's also suggested by Adobe to do session.save() for every 1000 nodes. But we couldn't find real examples and documentation about how to implement this in custom code. We would like to get some help with a couple of questions from the AEM experts here:

1. what the "nodes" here referring to? cq:Page nodes only or including nt:unstructed nodes?

2. is there any API to get the number of pending (in transient and unsaved yet) nodes in current session?

PS. we are on AEM 6.2 SP1 CFP14.

Any advice and suggestions would be appreciated! Thanks!

1 Akzeptierte Lösung

Avatar

Korrekte Antwort von
Level 3

It is nodes, so every nt:unstructed is considered node.

If you install a large package in AEM, ul see saving approx 1024 nodes... So in AEM standard is 1024 node changes and then save.

You need to keep track of number of nodes your code creates/change, and check if changes > 1024 you then can do session.save().

Lösung in ursprünglichem Beitrag anzeigen

1 Antwort

Avatar

Korrekte Antwort von
Level 3

It is nodes, so every nt:unstructed is considered node.

If you install a large package in AEM, ul see saving approx 1024 nodes... So in AEM standard is 1024 node changes and then save.

You need to keep track of number of nodes your code creates/change, and check if changes > 1024 you then can do session.save().