Oracle BPEL Process Manager Transaction Semantics

Transaction and Fault Propagation Semantics in BPEL Processes 12-3

12.1.1.2 BPELCaller Calls BPELCallee That Has bpel.config.transaction Set to required

In Table 12–3 , the BPELCaller process calls the BPELCallee process. The BPELCallee process has the property bpel.config.transaction set to required. Table 12–3 describes fault propagation and transaction behavior when bpel.config.transaction is set to this value. As an example, assume you create two synchronous processes BPELMaster and BPELChild that each use the same database adapter reference to insert the same record and therefore, causes a permission key PK violation. The xADatasourceName is set for both. Without bpel.config.transaction set, after the fault occurs, and it is not handled, BPELChild is rolled back. If BPELMaster has a catch block, its transaction is committed. Therefore, you end up with the record from BPELMaster in the database. If you do not catch the fault in BPELMaster as well, you get a second rollback however, in two different transactions. If bpel.config.transaction is set to required for the same test case and no fault handlers are in place, the entire transaction is rolled back based on BPELMasters unhandled fault. If you add a fault handler in BPELMaster to catch the fault from BPELChild and throw a rollback fault, the transaction is globally rolled back. This feature enables you to control transaction boundaries and model end-to-end transactional flows if your sources and targets are also transactional. Replies back with a fault FaultOne, and then throws a fault FaultTwo. Is rolled back. Gets FaultTwo. Throws a bpelx:rollback fault that is, it uses throw. Is rolled back. Gets a remote fault. Table 12–3 BPELCaller Calls BPELCallee That Has bpel.config.transaction Set to required If The BPELCallee... Then The BPELCaller... Replies with a fault that is, it uses reply. Gets the fault and can catch it. The BPELCaller owns the transaction. Therefore, if it catches it, the transaction is committed. If the BPELCaller does not handle it, a global rollback occurs. Throws a fault that is, it uses throw. Gets the fault and can catch it. Replies back with a fault FaultOne, and then throws a fault FaultTwo. Gets FaultTwo. Throws that is, it uses throw a bpelx:rollback fault. Gets its transaction rolled back; there is no way to catch it. This fault cannot be handled. Table 12–2 Cont. BPELCaller Calls BPELCallee That Has bpel.config.transaction Set to requiresNew If The BPELCallee... Then The BPELCallee Transaction... And The BPELCaller... 12-4 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite

12.2 Introduction to Execution of One-way Invocations

A one-way invocation with a possible callback is typically exposed in a WSDL as shown in Example 12–2 . Example 12–2 WSDL Exposure wsdl:operation name=process wsdl:input message=client:OrderProcessorRequestMessage wsdl:operation This causes the BPEL process service engine to split the execution into two parts: ■ For the first part, and always inside the caller transaction, the insertion into the dlv_message table of the dehydration store occurs in release 10.1.3.x, it was inserted into the inv_message table. ■ For the second part, the transaction and the new thread executes the work items, and a new instance is created. This has several advantages in terms of scalability, because the service engine’s thread pool invoker threads executes when a thread is available. However, the disadvantage is that there is no guarantee that it executes immediately. If you require a synchronous-type call based on a one-way operation, then you can use the onewayDeliveryPolicy property, which is similar to the deliveryPersistPolicy property of release 10.1.3.x. Specify bpel.config.oneWayDeliveryPolicy in the BPEL process service component section of the composite.xml file. If this value is not set in composite.xml, the value for oneWayDeliveryPolicy in the System MBean Browser in Oracle Enterprise Manager Fusion Middleware Control is used. The following values are possible. ■ async.persist: Messages are persisted in the database hash map. ■ sync.cache: Messages are stored in memory. ■ sync: Direct invocation occurs on the same thread. For more information about setting the bpel.config.oneWayDeliveryPolicy property, see Section C.1.1, How to Define Deployment Descriptor Properties. Table 12–4 describes the behavior when the main process calls the subprocess asynchronously. Table 12–4 is based on the use cases described in Section 12.1.1.1, BPELCaller Calls BPELCallee That Has bpel.config.transaction Set to requiresNew and Section 12.1.1.2, BPELCaller Calls BPELCallee That Has bpel.config.transaction Set to required. Table 12–4 Main Process Calls the Subprocess Asynchronously If... If The Subprocess Throws Any Fault... If The Subprocess Throws a bpelx:rollback... onewayDeliveryPolicy=async .persist The BPELCallee process runs in a separate threadtransaction. The BPELCaller does not get a response because the message is saved in the delivery service. The BPELCallee transaction is rolled back if the fault is not handled. The BPELCaller does not get a response because the message is saved in the delivery service. The BPELCallee instance is rolled back on the unhandled fault. Transaction and Fault Propagation Semantics in BPEL Processes 12-5 onewayDeliveryPolicy=sync and transaction=requiresNew The BPELCallee runs in the same thread, but a different transaction. The BPELCaller receives a FabricInvocationExce ption. The BPELCallee transaction rolls back if the fault is not handled. The BPELCaller receives a FabricInvocationExce ption. The BPELCallee transaction is rolled back. onewayDeliveryPolicy=sync and transaction=required The BPELCallee runs in the same thread and the same transaction. The BPELCallee faulted. The BPELCaller receives a FabricInvocationExce ption. The BPELCaller has a chance to handle the fault. The whole transaction is rolled back. Table 12–4 Cont. Main Process Calls the Subprocess Asynchronously If... If The Subprocess Throws Any Fault... If The Subprocess Throws a bpelx:rollback... 12-6 Oracle Fusion Middleware Developers Guide for Oracle SOA Suite