Skip Headers
Oracle® Retail Advanced Science Engine Implementation Guide
Release 14.1
E59126-02
  Go To Table Of Contents
Contents

Previous
Previous
 
Next
Next
 

8 Server Configuration

This chapter addresses the configuration of the Coherence Server. It contains the following section:

ORASE Coherence Server Configuration

In ORASE AC and ASO, if one computational node is insufficient to withstand the required computational load, Oracle Coherence cluster can be used to scale horizontally. Oracle Coherence is an Oracle product that provides a distributed grid and cache solution. The ORASE Coherence Server can be used by the related ORASE calculation modules.

ORASE Coherence Server Startup Script

The ORASE Coherence Server is started by the following shell script:

start_rse_coherence_srv.ksh

which is installed here:

<RSE_HOME>/common/RseCoherenceServer/scripts

This shell script can be adjusted to specify Java runtime parameters, such as

-Dtangosol.coherence.clusteraddress=<your_value>

The started process has to be monitored and restarted as needed.

All ORASE-specific xml configuration can be done in the corresponding xml files, which are installed here:

 <RSE_HOME>/common/RseCoherenceServer/config/common

The following files are configurable:

  • log4j.xml

  • tangosol-coherence-override.xml

  • jp-server-app-context.xml

  • META-INF/persistence.xml

This file does not need to be modified.

  • jpdb-application-context.xml

After making any necessary configuration changes, you can start the ORASE Coherence Server by following these steps:

  1. Change directory to <RSE_HOME>/common/RseCoherenceServer/scripts

    cd <RSE_HOME>/common/RseCoherenceServer/scripts
    
  2. Execute start_rse_coherence_srv.ksh

    nohup ./ start_rse_coherence_srv.ksh &
    
  3. Review the following two logs as necessary:

    <RSE_HOME>/common/RseCoherenceServer/scripts/bin/rse_server_stdout.log
    <RSE_HOME>/common/RseCoherenceServer/scripts/bin/rse_coherence_server.log
    

Logging Configuration

The log configuration file is located here:

<RSE_HOME>/common/RseCoherenceServer/config/common/log4j.xml

See http://logging.apache.org/log4j/2.x/manual/configuration.html#XML for details on configuration options.

Coherence Server Configuration

The Coherence Server configuration file is located here:

<RSE_HOME>/common/RseCoherenceServer/config/common/tangosol-coherence-override.xml

The default configuration for the ORASE Coherence Server is a Multicast Listener.

<multicast-listener>
        <address>224.10.0.0</address>
        <time-to-live>1</time-to-live>
        <join-timeout-milliseconds>1000</join-timeout-milliseconds>
</multicast-listener>

If multiple instances of the RSE Coherence Server are being run, the Multicast Listener Address must be unique for each instance of RSE Coherence Server and the respective ORASE Applications. The file that must be edited (and in sync between RSE Coherence Server and ORASE Applications) is tangosol-coherence-override.xml.

This file is located here:

<RSE_HOME>/common/RseCoherenceServer/config/common/tangosol-coherence-override.xml

For ORASE AC, the file is located here:

<RSE_HOME>/cdm/cis/application/CisSharedLib.war!WEB-INF/classes/tangosol-coherence-override.xml

For ASO, the file is located here:

<RSE_HOME>/so/application/SpaceOptimization_application1.ear!soviewcontroller.war!WEB-INF/classes/tangosol-coherence-override.xml

After editing this file (keeping the <address> in sync), you must update the CisSharedLib.war and SpaceOptimization_application1.ear in the WLS Domain.


Note:

If you cannot edit the deployed ear/wars in place, then you can expand CisSharedLib.war and SpaceOptimization_application1.ear!soviewcontroller.war manually and modify the files. CisSharedLib.war and SpaceOptimization_application1.ear!soviewcontroller.war must be then reconstituted properly.

See http://docs.oracle.com/cd/E18686_01/coh.37/e18677/appendix_operational.htm#BABHDDEH for details on configuration options.

ORASE Job Processor Configuration

The ORASE Job Processor configuration file is located here:

<RSE_HOME>/common/RseCoherenceServer/config/common/jp-server-app-context.xml

Modify this file to specify the number of threads to run:

<constructor-arg value="4"/> <!-- number of threads -->

The default value is 4.

Configure Database Connection for Coherence Server

<RSE_HOME>/common/RseCoherenceServer/config/common/META-INF/persistence.xml contains the Database Configuration details. The Oracle Wallet alias is used to connect the Coherence Server to the Database. This file is modified by the installer during installation, as %{RSE_DB_BATCH_USER}% is replaced with the appropriate value.

<property name="javax.persistence.jdbc.url" 
value="jdbc:oracle:oci:/@%{RSE_DB_BATCH_USER}%"/>

Update RSE_PROC_TASK_TMPL to Define Which Execution Mode to Use

When using the ORASE Coherence Server, update the table RSE_PROC_TASK_TMPL.

For ASO, execute this SQL:

update RSE_PROC_TASK_TMPL set PKG='coherenceAsynchService' where id = 2001001;commit;

For ORASE AC, execute this SQL:

update RSE_PROC_TASK_TMPL set PKG='coherenceAsynchService' where id = 211;
commit;

After updating RSE_PROC_TASK_TMPL, you must restart the WLS Domain.

Server Adapters

The following service adapters are available:

Table 8-1 Common Service Adapters

Bean ID Description

coherenceAsynchService

Asynchronously process in the Coherence grid

localConcurrentService

Asynchronously process locally

localSynchServiceNoDbLog

Synchronously process a step


Table 8-2 ASO Adapters

Bean ID Description

soLocalConcurrentService

Asynchronously process optimization requests


Table 8-3 DT Adapters

Bean ID Description

dtLocalConcurrentService

Asynchronously process DT stages

dtLocalSynchConcurrentService

Synchronously process DT model apply

dtBatchLocalConcurrentService

Asynchronously process DT export


Table 8-4 CDT Adapters

Bean ID Description

cdtLocalConcurrentService

Asynchronously process CDT stages

cdtLocalSynchConcurrentServiceNoDbLog

Synchronously process a CDT step


Table 8-5 Adding New Adapters

Field Description

ID

A unique bean name

Class

Class: oracle.retail.rse.common.jobprocessor.service.LocalServiceAdapter - Local (a)sync

Constructor-arg

logInDb : true or false

useCurrentThread : true or false

useCurrentThreadfixedThreadPoolSize : number of threads in a fixed pool or 0 to allow automatic grow / reduce


<bean id="serviceName" 
    class="oracle.retail.rse.common.jobprocessor.service.LocalServiceAdapter" 
    scope="singleton" lazy-init="true" destroy-method="close">
        <constructor-arg name="logInDb" value="false"/>
        <constructor-arg name="useCurrentThread" value="true"/>
        <constructor-arg name="fixedThreadPoolSize" value="2"/>
</bean>

As needed, new adapters can be added by entering the necessary information into the application's configuration XML. The application specific configuration files are located in directories within the <RSE_HOME>common/RseCoherenceServer/config directory. For example:

Here is an example of a service that does not create a record in the database, works synchronously, and uses two threads in a fixed thread pool:

Using stage-based execution. In the database, insert a root record into rse_proc_tmpl. Insert matching records into rse_proc_task_tmpl. Examples can be found in db/seed_data/rse_proc_task_tmpl.ctl files, this set is from DT:

Table 8-6 Example

Name Description

ID

It must be unique. A typical convention is to concatenate rse_proc_tmpl with 0 ; 1,... to show the tree-based dependency between the root entry, stages, and steps.

PROC_ID

It must match rse_proc_tmpl.id.

NAME

Free-form. It typically has a name of the process and stage or step number.

DESCR

Free-form.

STEP_NUM

It must be null for the first entry (a zero step).

PARENT_ID

The ID of the parent rse_proc_task_tmpl entry. It is null for the first entry (a zero step).

EXEC_PROC_ID

Not used / reserved.

SRVC_TYPE_ID

Not used / reserved.

SRVC_NAME

Not used / reserved.

PKG

A key word stage for a stage or the spring bean name for the adapter that runs this step.

PROC

N/A for a stage or the spring bean name that runs as part of this step.

DELETE_FLG

Null if not deleted.

ACTIVE_FLG

A value of T if this record is active.

MAX_RUN_TIME_MIN

Not used / reserved.

MAX_FAILURES

Not used / reserved.

RESTARTABLE_FLG

Not used / reserved.


Example:

"810"|"81"|"DT-RDF-Start"|"DT RDF - starting step"|""|""|""|""|""|"dtBatchLocalConcurrentService"|"dtRdfExportJob"|""|"T"|""|""|""
"8101"|"81"|"DT-RDF-Stage1"|"DT RDF -Stage1"|"1"|"810"|""|""|""|"stage"|"n/a"|""|"T"|""|""|""
"810110"|"81"|"DT-RDF-Stage1-step1"|"DT RDF -Stage1-step1"|"1"|"8101"|""|""|""|"localSynchServiceNoDbLog"|"dtPlsqlJob"|""|"T"|""|""|""
"8102"|"81"|"DT-RDF-Stage2"|"DT-RDF-Stage2"|"2"|"810"|""|""|""|"stage"|"n/a"|""|"T"|""|""|""
"810210"|"81"|"DT-RDF-Stage2-step1"|"DT-RDF-Stage2-step1"|"1"|"8102"|""|""|""|"dtLocalSynchConcurrentServiceNoDbLog"|"dtRdfJob"|""|"T"|""|""|""
"81021010"|"81"|"DT-Stage2-step1-substep1"|"DT-RDF-Stage2-step1-substep1"|"1"|"810210"|""|""|""|"localSynchServiceNoDbLog"|"dtRdfCalcJob"|""|"T"|""|""|""
"8103"|"81"|"DT-RDF-Stage3"|"DT-RDF-Stage3"|"3"|"810"|""|""|""|"stage"|"n/a"|""|"T"|""|""|""
"810310"|"81"|"DT-RDF-Stage3-step1"|"DT-RDF-Stage3-step1"|"1"|"8103"|""|""|""|"localSynchServiceNoDbLog"|"dtPlsqlJob"|""|"T"|""|""|""

A corresponding <RSE_HOME>/common/RseCoherenceServer/config/cdm/dt/dttojp-application-context.xml has the spring beans defined.

Predefined wrapper jobs: common jobs have been defined. The following is for a step wrapper job:

 <bean id="dtRdfJob" class="oracle.retail.rse.common.jobprocessor.job.StepWrapperJob"
    scope="prototype">
         <constructor-arg> <!-- properties -->
            <map>
                <entry key="CHECK_CANCELLED"><value>false</value></entry>
            </map>
         </constructor-arg>
</bean>

For a call that accepts a JDBC connection and an ID pointer of type long (to be executed as a step. Database entry examples are above):

<bean id="dtRdfCalcJob" class="oracle.retail.rse.common.jobprocessor.job.StepCalcWrapperJob"
    scope="prototype">
         <constructor-arg> <!-- properties -->
            <map>
                <entry key="CALL_CLASS"><value>oracle.retail.rse.cdm.dt.rdf.ModelApplyForRDF</value></entry>
                <!-- the signature must be Connection, long -->
                <entry key="CALL_METHOD"><value>skuStoreMultipliersforRDF</value></entry>
            </map>
         </constructor-arg>
</bean>

There are also PL/SQL execution beans, For example (database entry examples are above):

<bean id="dtPlsqlJob" class="oracle.retail.rse.common.jobprocessor.PlsqlJob"
    scope="prototype">
    <constructor-arg ref="dtPlsqlJobConfig"/>
</bean>
<util:map id="dtPlsqlJobConfig">
    <entry key="510110"><bean class="oracle.retail.rse.common.jobprocessor.PlsqlConfig">
                <constructor-arg >
                <value><![CDATA[declare v_id NUMBER;
                begin v_id := ?;
                end;]]></value></constructor-arg>
                <constructor-arg>
                    <list>
                        <value>batchId</value>
                    </list>
                </constructor-arg>
                </bean>
            </entry> …

Running through a batch script. Define the parameters in *-application-context.xml. For example:

<!-- param name - description -->
<bean id="dtRdfBatchParams" class="java.util.HashMap" scope="singleton"> <constructor-arg> <map key-type="java.lang.String" value-type="java.lang.String"> <entry key="userId" value="User who runs this batch"/> <entry key="versionId" value="Version ID to export (optional)"/>…

Provide a wrapper shell script. For example, (from dt_rdf_export.ksh):

P="-beanName dtRdfBatchParams -userId ${USER} -appName DT -procName DT_RDF -batchRunnerName RdfExportRunner -waitTime 5 -timeout 900"
Q="$JAVA_HOME/bin/java -cp $CP oracle.retail.rse.common.jobprocessor.job.RunnableInStagesServiceHelper ${P}"

Implementation-reserved JobType enum entries. Insert matching records into the database and use in the code as appropriate:

IMPL_0("IMPL", "IMPL_0"),
IMPL_1("IMPL", "IMPL_1"),
IMPL_2("IMPL", "IMPL_2"),
IMPL_3("IMPL", "IMPL_3"),
IMPL_4("IMPL", "IMPL_4"),
IMPL_5("IMPL", "IMPL_5"),
IMPL_6("IMPL", "IMPL_6"),
IMPL_7("IMPL", "IMPL_7"),
IMPL_8("IMPL", "IMPL_8"),
IMPL_9("IMPL", "IMPL_9");

The following tables are used:

  • PROCESS_STATUS. Reference table for the status IDs and descriptions.

  • RSE_PROC_TMPL. Batch description (metadata): the overall list of tasks.

  • RSE_PROC_TASK_TMPL. Job description (metadata): task steps.

    Core fields:

    • ID, PROC_ID. To be referred to from the Java / middle-tier code.

    • PKG. Spring bean name of the service adapter that runs the job.

    • PROC. Spring bean name of the actual job Java bean to execute.

  • E_PROC_REQ_QUEUE. Batch runtime (note that final status is only updated for a staged-type executions).

  • RSE_PROC_REQ_TASK_QUEUE. Job runtime, status.