Hi, I have 2 questions concerning given simplified code:
@Override
public T doInTransaction() {
...
List<Page> pages = pageManager.getPages(space, true);
for (Page page : pages) {
...
//some conditions
...
labelManager.addLabel((Labelable) page, someLabel);
...
}
}
So basically I want iterate over list of pages and give labels to relevant pages.
My questions are:
1. Question: Can getting all pages of given space cause memory issues? like for example having space with too many or too big pages, or combination of both would cause out of memory problems.
2. Question: Is above code a correct way, if I want to add/remove labels ? Or should the transactions be more grained (for example each call to addLabel would have it's own transaction) and wrapped in some kind of session?
Thanks for answers!