Sunteți pe pagina 1din 5

Scribd Upload a Document Search Documents Explore

Venki Dear

You're looking at our new document page format. If you prefer the old one, click here. Have any thoughts? Leave us your feedback.

not exist, a local transaction is created. Oracle BPEL Engine completes its local transaction either whena breakpoint activity (dehydration) occurs or at the end of the flow. The graphic illustrates thefollowing behavior: 1. The client initiates the JTA transaction and invokes a synchronous BPEL process.2. The synchronous BPEL process does not specify the transaction property (by default), andcreates a new local transaction , which is committed when the synchronous BPEL processsuccessfully ends and returns a response to the client.3. When the client invokes the asynchronous BPEL process, the message invocation is executedwithin the client JTA transaction, and not the asynchronous BPEL process, which executes inits own transaction. When the client JTA transaction commits, the BPEL synchronous instanceand asynchronous invocation message are committed to the database.4. If the JTA transaction is rolled back, the synchronous BPEL process transaction remainscommitted. Transaction Boundaries with Entity Variables A transaction with Entity Variables within a BPEL process: Starts when an Entity Variable is updated Ends with a commit being performed when o

A BPEL process dehydration or wait point occurs o A Scope containing the Entity Variable completes without fault Ends with a rollback being performed when a Scope containing the Entity Variable terminateswith an unhandled fault conditionWhen making changes to an Entity Variable through an assign operation the changes are made to acopy of the data local to the BPEL process. Typically, the local copy is fetched from database throughADF-BC service.The data changes are pushed back to the ADF-BC service, which commits the data, when: The BPEL process is dehydrated The Scope in which the Entity Variable is declared completes without propagating a faultDehydration of a BPEL process happens when the BPEL process cannot proceed, that is, the process(including all the parallel branches, if exists) are waiting for some incoming message (a <receive> activity) or some time-based event (a <wait> activity)All the work performed in the BPEL process will be grouped under one atomic transaction. Essentially,the dehydration point dictates the atomic transaction shape and boundary of the BPEL process.When the changes are performed by another remote service invoked by a BPEL process throughSOAP, the changes are executed in a different transaction context. Compensation and Transactions The problem with transactional-based processes is that a global XA transaction is not possible with anasynchronous service invocation. Asynchronous services perform transactions in their own localcontext. So, how do you get transactional behavior with long-running processes?By using compensation techniques, implemented with compensation handlers in BPEL, you canmanage transactional-style operations and error recovery across asynchronous operations. However, the service that provides the transactional operation must also provide the undo operation, which reversesthe effects of the transactional operation. This allows a BPEL process to manage what has been doneand enables it to undo the work done in the event of an error.The example mentioned is of a travel agency that orchestrates external services to manage a travelbooking for a customer. The complete transaction requires an airline reservation, car hire, andaccommodation to be done. If the airline and car reservations have been successfully made, and theaccommodation booking cannot be made due to room unavailability, then the process must be managedsuch that the airline and car reservations are undone. Compensating Transaction: Example The travel flow example is used to explain the key concept of compensating transactions. The Travelflow process scope contains a nested scope called Travel_Booking . The Travel_Booking scope is key to the implementation because it contains:

The nested scopes, containing activity sequences, to perform their do operation. Each scopehas a compensation handler with activities to perform their undo operation. The fault handlers to catch exceptions raised by do operations so that the appropriatecompensation can be performedThe example illustrates how compensation occurs when the last transactional operation, in the Do_Hotel scope fails. The flow shown includes the following:1. The Do_Airline successfully invokes the bookAirline operation.2. The Do_Car successfully invokes the bookCar operation.3. The Do_Hotel fails and throws RoomUnavailableException , indicating an error.4. The Travel_Booking Scopes Catch branch handles the exception and executes theCompensate activities.5. The Do_Car Compensation handler is processed to perform the cancelCar operation.6. The Do_Airline Compensation handler is executed to invoke the cancelAirline operation. Implementing Compensation in BPEL The key steps required to implement compensation in BPEL are:1. Create an outer scope containing all transaction operations.2.

Add an inner scope for each operation, containing the do operation activities.3. Add a compensation handler containing the undo operation activities to the inner scope.4. Add a fault handler (Catch branch) configured to listen for the specific error condition requiringcompensation to the outer scope.5. In the fault handler, add the Compensate activity configured with the name of the scope whosecompensation handler should be processed. The fault handler can include as many Compensateactivities needed to perform all the required undo operations for the error condition. Module Review In this module, we covered: Describe Transactions with Services Explain Transactional implications of Services Describe a Service Data Object (SDO) Manage Transactions with SDOs Explain compensation handling within a BPEL processNext, answer a series of simple questions to make sure you are ready to move on. (Quiz) Course Summary In this course, we learned about: Create a composite application in Oracle SOA Suite 11g by using the BPEL Process servicecomponent Orchestrate services in a composite application Implement coordination of services Manage transactions in a BPEL process How can I learn more ? So where can you find more information of these or other Oracle SOA Suite 11g topics? Many onlineresources are available including he sites shown here.From these locations, you can download the product installers, access the online productdocumentation, find additional instructor-led and self paced training course on this product and browseand participate in product-specific customer discussion forums.This concludes our self paced estudy course. We at Oracle know that your time and attention isvaluable and limited, so we sincerely hope this training has met your expectations and learningobjectives.

S-ar putea să vă placă și