3 WebLogic Deployment and Adapter Integration

This chapter includes the following topics:

Configuring the Adabas CDC Adapter In the Application Server

You can use WebLogic application server to deploy the Oracle Connect CDC adapter. This section describes how to deploy the CDC adapter, set up the necessary connections, and build the CDC Stream Positions table.

This section includes the following topics:

CDC Stream Positions Table Definition

You should create one CDC Stream Position table for each CDC adapter. The CDC Stream Positions table contains one row for each CDC process (for each captured table) to control its stream position and XA transactions. The following SQL statement is used to define the table in an Oracle database:

create table CDC_STREAM_POSITIONS(TABLE_NAME varchar(127) not null, STREAM_POSITION varchar(127), PREPARED_STREAM_POSITION varchar(127), ROLLBACK_STREAM_POSITION varchar(127), NEW_STREAM_POSITION varchar(127), XID_FORMAT int, XID_BRANCH varchar(128), XID_GLOBAL varchar(128));create unique index CDC_STREAM_POSITIONS_INDEX on CDC_STREAM_POSITIONS (TABLE_NAME);

You can use any table name, but you cannot change the column names.

The following table describes the CDC Stream Positions table columns.

Table 3-1 CDC Stream Positions Table

Column Description

TABLE_NAME

The name of the CDC table.

You should not change the data in this column.

STREAM_POSITION

The last committed stream position of the CDC process for the current table.

You should not change the data in this column.

PREPARED_STREAM_POSITION

The last prepared stream position of the CDC process for the current table.

You should not change the data in this column.

ROLLBACK_STREAM_POSITION

In a Rollback Loop, this column contains the stream position of the event that occurred at the time of the rollback.

NEW_STREAM_POSITION

You can enter a valid stream position value in this column to manually change the current stream position. Before you update this column, deactivate the corresponding CDC process.

Note: Ensure that the XID_FORMAT column has a null value. If the XID_FORMAT column is not null, do not enter a value for this column.

XID_FORMAT

XID_BRANCH

XID_GLOBAL

The last prepared XID fields. If the XID_FORMAT column is null, the stream position is committed. In this case the XID_BRANCH and XID_GLOBAL columns contain the last committed XID fields.


You should configure a WebLogic data source that provides access to the CDC Stream Position table.

Configuring the Adabas CDC Adapter Connection Factory

Deploy the Oracle Connect RAR into the WebLogic server.

You may create the appropriate connection factories for each CDC adapter.

This table describes the connection factory properties that are relevant for the Adabas CDC Adapter. Do not change the values of any of the other properties.

Table 3-2 Connection Properties for CDC Inbound Process

Property Description

eisName

Required. Sets the name of the adapter to use. The adapter is defined in the Oracle Connect server using Oracle Studio.

serverName

Required. Enter the name of the server with the TCP/IP address or host name where the Oracle Connect daemon is running. For more information, see Advanced Tuning of the Daemon for details about the daemon.

workspace

Required. Specifies the name of an Oracle Connect server workspace to use. For more information, see Workspaces for details about workspaces.

portNumber

Optional. Specifies the TCP/IP port where the Oracle Connect daemon is running on the server. The default port is 2551.

userName

Optional. Specifies a user who can access the Oracle Connect server. The user is defined in the Oracle Connect daemon configuration. For more information, see daemon Security and workspace Security for details about users allowed to access an Oracle Connect server

password

Optional. Specifies a valid password for the user.

firewallProtocol

Optional. Specifies the firewall protocol used: either none or fixedNat (the Nat protocol using a fixed address for the daemon). The default is set to none.

connectTimeout

Optional. Specifies the connection timeout in seconds. The default is 0, indicating that there is no connection timeout.

encryptionProtocol

Optional. Specifies the name of encryption protocol to use. The default is set to RC4. If the value of the property is not defined, the RC4 protocol is used.

encryptionKeyName

Optional. Specifies the name of the symmetric encryption key to use.

encryptionKeyValue

Optional. Specifies the value of the symmetric encryption key to use.

retryInterval

Optional. The amount of time the resource adapter waits if no events are found in the server before issuing the next request. The default value is 15 seconds.

jdbcDataSource

Required. The JNDI location of the JDBC Data Source that provides access to cdcStreamPositionsTable.

cdcStreamPositionsTable

The SQL table that is used to control the CDC inbound process. For more information, see CDC Stream Positions Table Definition for more information.


Configuring the JCA Configuration Files for the OracleAS CDC Adapter for Adabas

This section includes the following topics:

Creating JCA Configuration Files

Perform the following steps to create a binding file and a WSDL file for the CDC adapter using Oracle Studio:

  1. From the Start menu, select Programs, Oracle, and then select Studio.

  2. In the Design perspective, Configuration view, expand the Machine folder.

  3. Expand the machine with the CDC staging area.

  4. Expand the Bindings. The binding configurations available on this computer are listed.

  5. Expand the binding for the CDC staging area that you created. The name of the binding is the Project name for the CDC solution that you created in Oracle Studio with the suffix _SA.

  6. Expand the Adapters folder, right-click the adapter, and select Generate JCA Configuation Files.

    The JCA Configuration Files dialog box opens.

  7. In the Save to field, type the path to the location where you want to save the created files, or select Browse to browse to a location.

  8. In the JNDI Location change the default value for the WebLogic Connection Factory JNDI location, if necessary.

  9. Click OK to create the files in the specified location.

    The View Genereated Content dialog box opens. It provides links to the binding file (*.jca) and the WSDL file that are created. If you want to view or edit the files, click the appropiate link in the dialog box.

    Use these files when working with the BPEL Process Manager or Mediator.

Configuring the Binding File

You should not edit the WSDL file generated by Oracle Studio. You may edit the binding file to configure the AttuCDCActivationSpec properties. Most of these properties can also be provided using the Connection Factory. For information on how to configure the Connection Factory, see Configuring the Adabas CDC Adapter Connection Factory. You may also need to configure the retryIntervalproperty in the binding file.

The binding file specifies the name of the adapter's connection factory as the value of the adapterInstanceJndi attribute of the <jca:address> element in the <service> section. If a connection factory exists on the application server, its properties are taken. Otherwise, the properties specified by the AttuCDCActivationSpec are used. If a value is specified by both the connection factory and the AttuCDCActivationSpec, the AttuCDCActivationSpec property overrides the value in the connection factory. If you want to use the value specified in the connection factory, you must delete the property from the binding file.

The following is an example of a CDC binding file:

<?xml version="1.0" encoding="UTF-8"?><adapter-config adapter="Legacy Adapter" name="calc" xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">    <connection-factory UIConnectionName="pcbpel" csfKey="pcbpel" location="eis/legacy/calc"/>        <endpoint-interaction operation="add" portType="calcPortType">        <interaction-spec className="com.attunity.adapter.oracle.AttuInteractionSpec">            <property name="FunctionName" value="add"/>                        <property name="ExecutionTimeout" value="120"/>            </interaction-spec>    </endpoint-interaction>    <endpoint-interaction operation="display" portType="calcPortType">        <interaction-spec className="com.attunity.adapter.oracle.AttuInteractionSpec">            <property name="FunctionName" value="display"/>                        <property name="ExecutionTimeout" value="120"/>            </interaction-spec>    </endpoint-interaction>    <endpoint-interaction operation="div" portType="calcPortType">        <interaction-spec className="com.attunity.adapter.oracle.AttuInteractionSpec">            <property name="FunctionName" value="div"/>                        <property name="ExecutionTimeout" value="120"/>            </interaction-spec>    </endpoint-interaction>    <endpoint-interaction operation="mul" portType="calcPortType">        <interaction-spec className="com.attunity.adapter.oracle.AttuInteractionSpec">            <property name="FunctionName" value="mul"/>                        <property name="ExecutionTimeout" value="120"/>            </interaction-spec>    </endpoint-interaction>    <endpoint-interaction operation="sub" portType="calcPortType">        <interaction-spec className="com.attunity.adapter.oracle.AttuInteractionSpec">            <property name="FunctionName" value="sub"/>                        <property name="ExecutionTimeout" value="120"/>            </interaction-spec>    </endpoint-interaction></adapter-config>

You must configure the following property in the binding file.

retryInterval: The amount of time the resource adapter waits if no events are found in the server before issuing the next request. The default is set to 15 seconds. This is optional.

High Availability

The Oracle legacy adapters for OracleAS support High Availability using OracleAS clusters with active-active and active-passive topologies.In an active-active topology Oracle Application Server provides an active-active redundant model for all its components with OracleAS Clusters. In an OracleAS Cluster, two or more Oracle Application Server instances are configured to serve the same application workload. These instances can reside on the same computer or on different computers. The active instances may be front-ended by an external load balancer, which can redirect requests to any of the active instances, or by some other application-level configuration, such as address lists, to distribute the requests.In an active-passive topology Oracle Application Server supports Active-passive model using OracleAS Cold Failover Clusters. In this case two or more application server instances are configured to serve the same application workload, but only one is active at any time.

For High Availability support in CDC Adapters, all the instances must have access to the Oracle database specified by the jdbcDatasource parameter in the binding file.

Troubleshooting Rollback Loops

When a problem occurs in the CDC resource adapter work thread, the thread waits for a defined period (retryInterval) then retries the last operation. If you want to stop the adapter, you must deactivate the endpoint. The behavior of the resource adapter is different according to the type of rollback loop. In all cases, the resource adapter writes the corresponding error messages to the resource adapter log file and sends the message to the message listener onAlert method.

  • If the connection to Oracle Connect is lost, then the resource adapter always waits for a defined period (retryInterval) until the connection is reestablished.

  • In all other cases, the resource adapter retrys the last operation immediately and if the problem returns, the resource adapter waits for acsending periods of time, beginning with the retryInterval and doubling the wait time for each successive attempt, but not for more than one minute.

    If the OracleAS resource manager invokes a rollback before a 2PC prepare operation, then the CDC resource adapter take steps to perform a special operation that assists you in troublshooting the problem. In this case, the resource adapter separately sends each event from the last event array to the BPEL endpoint, which saves the stream position of the last problematic event in the ROLLBACK_STREAM_POSITION column.

    If you notice that a rollback loop occurs in the CDC resource adapter work thread, check the value of the ROLLBACK_STREAM_POSITION is not null. If the value is not null, check whether there was a data problem. You can select the problematic event from the staging area, using the current stream position value. In this way you can analyze the data to determine what the problem is. In addition, you can skip the problematic event. In this case you stop the endpoint and update the NEW_STREAM_POSITION column with the value of the ROLLBACK_STREAM_POSITION.