08.06.2014 Views

Download PDF (1.3 MB) - IBM Redbooks

Download PDF (1.3 MB) - IBM Redbooks

Download PDF (1.3 MB) - IBM Redbooks

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Avoiding two-way synchronous invocation of an asynchronous target<br />

If the target component must be started asynchronously and its interface is of two-way<br />

request/response style, then the target cannot be safely started through synchronous SCA<br />

calls. After the caller sends the request to the target, it waits for response from the target.<br />

Upon receiving the request, the asynchronous target starts a new transaction. Upon<br />

processing the request, the target returns the response asynchronously to the caller through<br />

the response queue. If a system failure occurs after the caller successfully sends the request<br />

but before receiving the response, the caller transaction is rolled back and tried again. As a<br />

result, the target is started a second time.<br />

Taking advantage of transactional attributes for activities in<br />

long-running processes<br />

Although SCA qualifiers control component-level transactional behavior, additional<br />

transactional considerations in long-running business processes can cause activities to run in<br />

multiple transactions. You can change the scope of those transactions and the number of<br />

transactions using the transactional behavior settings on Java Snippet, Human Task, and<br />

start activities. For a detailed description of these settings, see “Transactional behavior of<br />

business processes” in the Business Process Manager 8.0 information center:<br />

http://pic.dhe.ibm.com/infocenter/dmndhelp/v8r0mx/index.jsp?topic=%2Fcom.ibm.wbpm.<br />

bpc.doc%2Ftopics%2Fcprocess_transaction_macro.html<br />

You have four setting choices for transactional behavior:<br />

► Commit before<br />

Use the Commit before setting in parallel activities that start new branches to ensure<br />

parallelism. As noted in the information center, you must consider other constraints.<br />

► Commit after<br />

Use Commit after for inline human tasks to increase responsiveness to human users.<br />

When a human user issues a task completion, the thread/transaction handling that action,<br />

is used to resume navigation of the human task activity in the process flow. The user’s task<br />

completion action does not complete until the process engine commits the transaction.<br />

Starting with WebSphere Process Server 6.2.0, Receive and Pick activities in BPEL flow<br />

are allowed to define their own transactional behavior property values. If not set, the<br />

default value of initiating a Receive or Pick activity is Commit after. Consider using<br />

Participates where possible because that behavior performs better.<br />

► Participates<br />

If the Participates setting is used, the commit is delayed and forces a longer response<br />

time for the user. Only the Participates setting does not require a new transaction<br />

boundary. The other three settings require the process flow container to start a new<br />

transaction before executing the activity, after executing the activity, or both.<br />

In general, the Participates attribute provides the best throughput and should be used<br />

where possible. This suggestion is true for both synchronous and asynchronous activities.<br />

In the two-way asynchronous case, it is important to understand that the calling<br />

transaction always commits after sending the request. The Participates setting refers to<br />

the transaction started by the process engine for the response. When set, this setting<br />

allows the next activity to continue on the same transaction.<br />

In special cases, transaction settings other than Participates might be preferable. Review<br />

the Business Process Manager 8.0 information center for more guidance about this issue.<br />

► Requires own<br />

The Requires own setting requires that a new transaction be started.<br />

Chapter 3. Development best practices 39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!