February 26, 2008

Transaction Timeout - ** The secret File **

Well, let me just say that I've spent a lot of time researching the topic of transaction timeout's.  I currently have a BPEL process that calls a database procedure which runs for about four minutes.  I have been having all kinds of trouble with this process because the server transaction time's out after about 60 seconds.  If you do any searches on OTN or Metalink you will discover that the two important areas to adjust are the JTA transaction-timeout parameter and the syncMaxWaitTime parameter.  I had made these changes, but was still having all kinds of problems with timeout.  I ended up creating a pl/sql script to see exactly how long a db operation can last before the transaction would timeout.  Here is the code for the procedure:

create or replace procedure wbr_sleep (p_time IN number) as
begin
dbms_lock.sleep(p_time);
end;
/

I finally have come across the solution to this transaction timeout problem. First of all, here is the link to the documentation:



Oracle BPEL Troubleshooting Guide



Here is the file I was missing:


<your SOA_Oracle_Home>\j2ee\<your oc4j instance name>\application-deployments\orabpel\ejb_ob_engine\orion-ejb-jar.xml

In this file you will find a number of transaction-timeout attributes. The values assigned to these attributes should be greater than your syncMaxWaitTime but less than the value of your JTA transaction-timeout value.  Once I made this change, I have been able to execute long running db calls.  Here is what my environment settings are currently:



   1: JTA Transaction timeout = 7200
   2: orion-ejb-jar.xml (all timeout parameters) = 3600
   3: syncMaxWaitTime = 330



February 15, 2008

Variable Reuse Temptation

multi-invoke

When you have a partner link that gets executed multiple times throughout your BPEL process, there is a temptation to invoke that service with the same input and output variables that you used before.  While this can work, you should be aware of some of the pitfalls in doing this:

  1. If you don't explicitly set each input parameter each time you execute the partner link, you will be using a value from the last time that values where copied to the variable.
  2. If you are executing the same partner link in a parallel branch, do not use the same input and output variables.  You WILL have a conflict.
  3. If you reuse input and output variables, it makes it a little more challenging to determine assignment problem throughout your process.
  4. One advantage of reusing an input and output variable is that in a large BPEL process reuse produces less assignment clutter.  You can generically name the variable and use it throughout your process.
  5. If your assign is copying namespace info, you can end up having exceptions due to different or unrecognized ns assignments.

So to wrap this up.  As a general rule, when you are reusing a partner link.  Always create a new set of input and output variables for each invocation.  This will spare you a lot of debugging problems down the road.

If you have any additional advantages or disadvantages about variable reuse, please comment.