icon-arrow icon-check icon-mail icon-phone icon-facebook icon-linkedin icon-youtube icon-twitter icon-cheveron icon-download icon-instagram play close close icon-arrow-uturn icon-calendar icon-clock icon-search icon-chevron-process icon-skills icon-knowledge icon-kite icon-education icon-languages icon-tools icon-experience icon-coffee-cup
Werken bij Integration & Application Talents
Blog 19/09/2014

BPEL 11g threads in parallel flow

Parallel flow

Whitehorses
Laurens van der Starre /
Integratie expert

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.

Overzicht blogs

Geen reacties

Geef jouw mening

Reactie plaatsen

Reactie toevoegen

Jouw e-mailadres wordt niet openbaar gemaakt.

Geen HTML

  • Geen HTML toegestaan.
  • Regels en alinea's worden automatisch gesplitst.
  • Web- en e-mailadressen worden automatisch naar links omgezet.
Whitehorses
Laurens van der Starre /
Integratie expert

Wil je deel uitmaken van een groep gedreven en ambitieuze experts? Stuur ons jouw cv!