Set conditions for running background jobs

You can configure the settings of recalculation jobs that Deployment Automation runs in the background.

About background jobs

Deployment Automation runs security jobs and process request jobs in the background.

Process request jobs recalculate the status of requests submitted in Deployment Automation before the server upgrade. These jobs store the status of each request in the database for easy retrieval, improving Deployment Automation performance when opening and processing timelines and deployment history.

Tip: To view how many process requests need recalculating, go to Deployment > Timeline and select the calendar view for a specific month or year. The number of such requests is displayed with the Unknown status. For details, see View deployment timelines.

You can change the following background job settings:

  • The daily timeframe when background jobs are allowed to run. Because background jobs may slow the server while they are running, we recommend that you limit them to a low or no activity time.

  • The delay threshold that determines which jobs are delayed until the allowed timeframe.

  • The maximum number of items processed by a single security job.

  • The maximum number of durable events processed by any job. For Oracle databases, this number must not exceed 999.

For details, see Set up background job runs.

You can also configure logs to include trace information about database queries. For details, see Extend logs for background jobs.

Back to top

Set up background job runs

To configure background jobs, change the materializedViewJobsConfig settings in the server's da_config.xml file.

To set the conditions for running background jobs:

  1. Go to the Common Tomcat da\WEB-INF\classes directory, for example:

    C:\Program Files\Micro Focus\common\tomcat\9.0\webapps\da\WEB-INF\classes
  2. Open the web application's da_config.xml file. This file contains your current settings for background jobs.
  3. Copy the <materializedViewJobsConfig> section from the da_config.xml file.

    For example:

    Copy code
    <materializedViewJobsConfig>
       <allowedTimeframeStart>19:00</allowedTimeframeStart>
       <allowedTimeframeEnd>07:00</allowedTimeframeEnd>
       <outdatedSecurityRowsBatchSize>1000</outdatedSecurityRowsBatchSize>
       <cleanupTopicDeleteBatchSize>999</cleanupTopicDeleteBatchSize>
       <delayThreshold>25</delayThreshold> 
    </materializedViewJobsConfig>
  4. Go to the DA user profile directory where the DA server configuration is stored, for example:

    C:\Users\<username>\.microfocus\da\conf\server
  5. Open the da_config.xml file in the DA user profile and paste the copied <materializedViewJobsConfig> section there.

    Note: Deployment Automation contains two da_config.xml files, one in the web application and one in the DA user profile. After each server upgrade, the web application's da_config.xml settings are restored to default. To make your modifications permanent, save them in the da_config.xml file located in the DA user profile directory.

  6. In the <materializedViewJobsConfig> section, modify the following settings as needed:

    Setting Description
    <allowedTimeframeStart>

    The time to start running background jobs, in a 24-hour format, according to your system's timezone.

    By default, background jobs start running at 19:00.

    <allowedTimeframeEnd>

    The time to finish running background jobs, in a 24-hour format, according to your system's timezone.

    By default, background jobs finish running at 07:00.

    <outdatedSecurityRowsBatchSize>

    The maximum number of items that a single security job can process in the background.

    By default, one security job processes 1000 items.

    <cleanupTopicDeleteBatchSize>

    The maximum number of durable events that a job can process.

    By default, a job processes a batch of 999 records, though the durable events table may contain many more records.

    Caution: For an Oracle database, do not exceed the default number. Having 1000 or more records in a list results in an error due to Oracle limitations.

    <delayThreshold>

    The threshold that defines which background jobs run immediately, and which are delayed until the allowed timeframe.

    Each job has a rank automatically assigned by the system. By default, jobs with the rank of 25 or lower are delayed until the time when background jobs are allowed to run. The allowed timeframe is set in the <allowedTimeframeStart> and <allowedTimeframeEnd> parameters.

  7. Save your changes.
  8. Restart Common Tomcat.

Tip: You can review the status of process request jobs. Enter the following URL in your web browser:
<serverName>:<port>/da/rest/internal/materializedViewJobsStatuses

Back to top

Extend logs for background jobs

You can extend logging for background jobs to include trace messages about database queries.

For details about viewing logs, see View the output log.

To enable trace logging for background jobs:

  1. Go to the DA user profile directory where the DA server configuration is stored, for example:

    C:\Users\<username>\.microfocus\da\conf\server
  2. In the DA user profile, open the log4j2.properties file and add the following lines:

    Copy code
    logger.com_urbancode_security_cache_service.name=com.urbancode.security.cache.service
    logger.com_urbancode_security_cache_service.level=TRACE

    logger.com_serena_ra_jobs.name=com.serena.ra.jobs
    logger.com_serena_ra_jobs.level=TRACE

    logger.com_serena_ra_durable_events.name=com.serena.ra.durable_events
    logger.com_serena_ra_durable_events.level=TRACE
  3. Save your changes.

Back to top

See also: