Follow Us on Twitter

BPEL 11g threads in parallel flow

by Laurens van der Starre on September 19, 2014 · 2 comments

A lot has been written about the transactions, boundaries, threads etc in the Oracle SOA Suite. Clemens has written this piece years ago which explains the basics.I recently had a ‘disagreement’ with the SOA threadpool when I was using a parallel flow in a synchronous BPEL process.

The requirement was to guard the execution time of this BPEL process to a predefined maximum amount of seconds. The environment is as such that tweaking the syncMaxWaitTime, or JTA timeout properties would not be the solution. An Pick activity with an onAlarm doesn’t work either because you can’t create an synchronous BPEL (2.0) instance using an onMessage branch.

The solution is quite simple though. Just create a parallel flow with an Wait activity that waits for the predefined amount of time and then throws an error.

Example of BPEL parallel flow.

Example of BPEL parallel flow.


The thing is that a parallel flow isn’t parallel at all. It runs in a single thread. Lets say that the Wait is to be for 20s. And in the “main flow” there is an Invoke activity that takes 30s. This Invoke blocks the thread and the Wait activity will never trigger in time.  Oops.

The solution is straight forward: release the thread! Make the Invoke activity a “nonBlockingInvoke”. Set this property on the specific PartnerLink and the invocation gets its own thread. Your Wait activity will trigger in time.

BPEL 11g threads in parallel flow, 3.0 out of 5 based on 3 ratings
VN:D [1.9.22_1171]
Rating: 3.0/5 (3 votes cast)

{ 2 comments… read them below or add one }

Suresh April 17, 2017 at 8:28 am

Thanks for your post.
I have a similar scenario, where one flows invokes a db procedure, other flow throws timeout exception after the specified time expires.
My question is how to terminate the first flow gracefully after timeout exception. The flow is always in pending state.


Laurens van der Starre April 18, 2017 at 3:14 pm

I don’t think this is possible… You’ll have to terminate the flow.


Leave a Comment


Previous post:

Next post:

About Whitehorses
Company profile

Whitehorses website

Home page

Follow us
Blog post RSS
Comment RSS