Tuesday, April 13, 2010

JCA Resource Adapter transaction management in BPEL

The JCA Resource Adapter can support transactions on systems with a BPEL client. When designing your BPEL processes, keep the following in mind:

  • A good practice is to define a scope within BPEL processes where a sequence of opcodes called with a transaction are executed, and to add a catch block in this scope and call abort if any error occurs.
  • The BPEL processes must abort all open transactions when any exception occurs, except for CommException. The JCA Resource Adapter throws CommException when the Portal Context closes or errors out but the transaction cannot be aborted.
  • The transaction operations described in the base Web service must not be used in a BPEL section that can trigger process hibernation or parallel processing. Those transaction operations must be in a BPEL section that performs synchronous invoke.

Note

The JCA Resource Adapter does not support nested transactions.

To set up JCA Resource Adapter transaction management in BPEL, perform the following:

  • In the BPEL client, set these BPEL partnerLink properties:
  • cacheConnections=false

When set to “false”, it releases connection right after completing the unit of work, and connection is available to OC4J connection pool.

  • useJCAConnectionPool=true

If we set this to true then it will ensures single threading through JCA LocalTransactions.

  • In the JCA Resource adapter, create a private connection pool for the connection factory.

Example :
1. Connection Pooling Scheme : Dynamic
2. Maximum Connections : 200
3. Minimum Connection : 50
4. Fixed Wait Timeout : 0

5. Expired Connection Cleanup: Periodically
6. Inactive Connection Timeout: 300

Maximum Connection= dm_n_fe * dm_max_per_fe

dm_n_fe and dm_max_per_fe entries in dm_oracle pin.conf. Increase the values if required.

You encounter the following exception when the above steps are not performed properly or when one of the BPEL processes fails to close a transaction.

§ java.lang.IllegalStateException: New ManagedConnection cannot be created for a thread which is already in BRM transaction

§ Adapter Framework unable to create outbound JCA connection.

Friday, April 9, 2010

SOA Cluster Installation - Issues & Resolutions

Some issues that we might face during cluster installation:

Issue#1:

XML Parsing Error: no element found on esb console

Resolution#1:

The cause of the error was cluster_name collision for esb-dt and esb-rt.

vi $ORACLE_HOME/j2ee/oc4j_soa/applications/esb-rt/META-INF/orion-application.xml
vi $ORACLE_HOME/j2ee/oc4j_soa/application-deployments/esb-rt/orion-application.xml

Change “cluster_name” value to “ESBCluster” from "esb". Update your esb systems with this name on esb console i.e. update Cluster Name of each system with "ESBCluster".

Issue#2:

You see message “You have more than one instance of the Application Server Control application running in this cluster. This is not a recommended configuration and could lead to unexpected problems. Please stop the additional instances of Application Server Control or disable routing to these instances.” on the enterprise manager console.

Resolution#2:

Execute below command on all the non primary nodes.

opmnctl stopproc process-type=admin application=ascontrol

Issue#3:

When replacing the existing OPatch with a new patch then on running command opatch –version below error might come:
-bash: $ORACLE_HOME/OPatch/opatch: Permission denied

Resolution#3:

cd $ORACLE_HOME

chmod -R 755 OPatch

Issue#4:

java.net.SocketTimeoutException: Read timed out or java.net.SocketTimeoutException: connection reset when trying to initiate a bpel process on the bpel console.

Resolution#4:

Modify httpd.conf available at $ORACLE_HOME/Apache/Apache/conf on all the nodes.

Set KeepAlive as ‘Off’. Restart HTTP Server using command

opmnctl startproc process-type=HTTP_Server

I also recommend to cross check your load balancer setting. Sometime incorrect setting also causes this issue.

Issue#5:

An unhandled exception has been thrown in the ESB system. The exception reported is: "java.lang.Exception: Failed to create "ejb/collaxa/system/DeliveryBean" bean; exception reported is: "javax.naming.NameNotFoundException: ejb/collaxa/system/DeliveryBean not found

Resolution#5:

Modified ant-orabpel.properties file available @ $ORACLE_HOME/bpel/utilities.

Cluster=true

oc4jinstancename = SOA_GROUP

local.oc4jinstancename = oc4j_soa

Please make sure there is no space after true,SOA_GROUP and oc4j_soa.

Issue#6:

During installation of Oracle Service Registry, the installation fails with “null

Installation failed. If accessible, see "/oracle/registry_10_1_3/log/install.log".

To correct installation parameters and resume installation click Recover.” error.

Resolution#6:

One cause of this error is incorrect java version.

[oracle@HOSTNAME ~]$ java -version

java version "1.4.2"

gij (GNU libgcj) version 4.1.2 20080704 (Red Hat 4.1.2-44)

update the JAVA_HOME to point to the soa suite java

export JAVA_HOME=$ORACLE_HOME/jdk

Issue#7:

During installation of DB, swap space requirements availability check the expected result ie swap memory is less than the actual result.

Resolution#7:

You can resolve this issue by creating a swap file. If installer is expecting 7832 the swap should have 7832*1024 = 8019968

1. Login as root

2. dd if=/dev/zero of=/swapfile bs=1024 count=8019968

8019968+0 records in

8019968+0 records out

8212447232 bytes (8.2 GB) copied, 82.5765 seconds, 99.5 MB/s

3. mkswap /swapfile

Setting up swapspace version 1, size = 8212443 kB

4. swapon /swapfile

5. Edit /etc/fstab

/swapfile swap swap defaults 0 0

6. Verify by cat /proc/swaps

7. Exit from root

Monday, April 5, 2010

Cannot find service on current cluster

This issue comes on High Availability Cluster environment.

The various cause of this issue are:
1. Cluster setup issue -
a. Slide Repository not configured to use the Database as the Repository
b. JNDIs for the Topic and Topic Connection Factory not created for esb-dt and esb-rt.
If any or both of the above configuration is missing then you have to do it on all the nodes and for both esb-dt and esb-rt(oc4j_soa) containers.

2. On ESB Console, cluster name is not set to esb-rt cluster_name. Verify on all nodes that the cluster_name @ $ORACLE_HOME/j2ee//applications/esb-rt/META-INF/orion-application.xml and $ORACLE_HOME/j2ee/oc4j_soa/application-deployments/esb-rt/orion-application.xml. e.g. cluster_name should be "ESBCluster" in both the files and not "esb". Then we need to update all the ESB systems cluster name by replacing "esb" with "ESBCluster". Restart the server if any of the above is modified.

3. The ESB Service is missing on the other nodes.
Run Opmnctl status -app|grep esb-rt
if for esb-rt, routable=false then update ohs-routing="false" to "true" at $ORACLE_HOME/j2ee/OC4J_SOA/config/default-web-site.xml where web-app application="esb-rt" name="provider-war" load-on-startup="true".

Hope this help ...