Some 'more, in-depth' information on Oracle BPEL PM, ESB and other SOA, day2day things

Saturday, March 11, 2006

loosely coupled and transacted ?!

During the last days some fellows from all around asked me on the same thing - what's on with transactions in a BPEL process, can a partnerlink participate, what are the limitations and so on. After consulting our engineers, I thought to put a little note together, that explains the basic concepts, supported combinations, and their impacts.

In general, each partner called from within a process can participate in the global transaction, but this has to be specified on PLNK level (through setting the participate property to yes)

Lets consider a simple usecase, a sync process that takes the input and saves it into the DB (by using the DB Adapter functionality). If you just deploy this process and run it, the record will be commited immediatly at the invoke time of the partnerlink. Why, because Toplink used its own connection pool, that is not aware of any global jta transaction.

Solution: use an XA aware datasource (ejb-location) - specify the participate property, and we will do the rest for you.
But where in the lifecycle of the process does the global commit happen? In this usecase, the engine will commit with the time it has replied. Time to discover the whys here..

Understanding BPEL PMs transactional behaviour turns down to one question, when, at what points, does the engine commit.

These commits happen ..

  • before a receive activity (but not the initial one!)

  • before a wait activity (otherwise the engine could run into a tx timeout)

  • before an onMessage, or pick(extended onMessage) activity

  • when using checkPoint() within a bpelx:exec activity



Another interesting usecase is an external call, say to a java class through WSIF (Apache Webservice Invocation Framework) - guess what, the same rules apply, given you specify the participate property on the partnerlink. This means if you lookup a transactional Datasource from within your java class, that is bound through wsif, the commit on this DS will happen within the global JTA commit cycle, based upon the process activities that follow your java callout.

Having questions? send your feedback on loosely coupled OR transacted here

1 Comments:

Anonymous Anonymous said...

I assume this is valid with the Database adapters bundled with Oracle BPEL PM 10.1.3.1. Thanks for the details.

8:57 PM

 

Post a Comment

<< Home