Delayed cleanup of deleted portal pages
Portal resources, such as pages, components or portlet instances are kept persistent in the portal database. When an administrator deletes a page, all its derived pages and dependent resources and content are deleted with it. The actual deletion can take considerable time, depending on the size of the portal and the number of resources affected by the deletion. If the deletion takes place immediately after the user completes the deletion task, this might impact portal performance for users. On the other hand, if the deletion is delayed and scheduled for an off peak time, it will not affect portal response time and thereby user experience.
The delayed deletion of pages is performed by a cleanup service.
Configure immediate or delayed deletion of portal pages
Configure the deletion cleanup to happen either immediately when you delete the page or later:
- Immediate deletion
The page and all resources that depend on it are deleted immediately after the user completes the action for the deletion.
- Delayed deletion
The page is marked for deletion, but the page and all dependent resources are actually deleted later.
Once the page has been marked for deletion, users cannot view or otherwise access the page any longer.
We can change between the immediate and delayed deletion of portal pages by configuring the property value...
scheduler.cleanup.enabled
...in the Data Store Service. For more details about this refer to the topic about Portal configuration services, under the section about Data Store service.
Set the following Data Store service configuration parameters as required:
- scheduler.cleanup.enabled = (true)
- Whether deletion of portal pages is performed later by the scheduled cleanup service, or immediately after the user completes the deletion task. This affects the deletion of portal pages and all their dependent resources, such as components and portlet instances.
- true
- Enable delayed deletion of portal pages by the scheduled cleanup service. Pages and dependent resources are deleted by the scheduled cleanup service.
- false
- Disable deletion of portal pages by the scheduled cleanup service. Deletion of the pages and their dependent resources is triggered immediately when the administrative user runs the cleanup task.
Set to true if you want the deletion of pages to be delayed and performed by the scheduled cleanup service. This property defaults to true, if the portal installation is based on a version of IBM WebSphere Application Server that includes the Scheduler service.
By its default schedule configuration, the cleanup service runs weekly, on Saturdays at 8 pm.
Configure our own delayed deletion schedule using xmlaccess.sh
We can use xmlaccess.sh to configure the delayed deletion schedule according to the requirements. We can define a daily, weekly, or monthly schedule. We can also use xmlaccess.sh to run individual cleanup tasks at arbitrary intervals.
To run cleanup tasks at arbitrary intervals:
- Open a UNIX System Services (USS) command prompt.
- Edit the following sample XML configuration file:
PORTAL_HOME/PortalServer/doc/xml-samples/Task.xml
- Uncomment and edit the entry that corresponds to the scheduled time to set.
By default, the Task.xml file is set to run the scheduler immediately one time.
- Save your changes.
- Import the modified Task.xml file using XmlAccess.
For the customized schedule to be observed by the portal, enable the scheduler.cleanup.enabled property by setting it to true in the DataStoreService.
If you delete a page with an object ID and then use xmlaccess.sh to re-create the same page with the same object ID, we might receive an error message indicating the operation was canceled because it would have caused a duplicate key value.
When you run the cleanup task, xmlaccess.sh only schedules the task to be run in WAS and returns. This does not necessarily mean that WAS runs the task immediately. To determine when a task started and ended, check the portal log SystemOut.log for the EJPDE0005I and EJPDE0006I messages. These messages confirm that the cleanup task has successfully completed. After you have confirmed this, we can run the XML script for re-creating a page with the same object ID as it had before the deletion.
Parent: Configure portal behavior
Related:
Set service configuration properties
XML configuration reference
Sample XML configuration files
Portal configuration services
Work with xmlaccess.sh