IBM BPM, V8.0.1, All platforms > Programming IBM BPM > Service Component Architecture programming > SCA programming model fundamentals > Invocation styles
Synchronous-over-asynchronous invocation
Avoid using synchronous-over-asynchronous invocation, which occurs when a component synchronously calls another component that has an asynchronous implementation.
When synchronous-over-asynchronous invocation is detected at run time, the SCA automatically changes the synchronous call to an asynchronous call, which creates a new transaction boundary and can cause one or more of the following problems:
- Lack of transaction propagation
- Multiple retries that result in multiple invocations of the same service
- Time outs when the default wait time for invocations is exceeded
- Blocked threads and thread pool depletion, which are caused when a thread is allocated for each asynchronous call and waits for a response
Most synchronous-over-asynchronous invocations occur when you have a component that synchronously calls one of the following components that typically have asynchronous implementations:
- Long-running BPEL and BPMN business processes
- Human tasks
- JMS imports
- MQ imports
- Java POJO components that implement the ServiceAsynchImpl interface
For example, a web service export always performs a synchronous call. If an export synchronously calls a long-running BPEL process, a synchronous-over-asynchronous invocation occurs. Similarly, a microflow always performs a synchronous call for a request-response operation.
If a microflow invokes an MQ import for a request-response operation, a synchronous-over-asynchronous invocation occurs.
In general, avoid the following scenarios that might result in a synchronous-over-asynchronous invocation:
- A web services export calling a long-running BPEL or BPMN business process
- A web services export calling a message-binding import, such as an MQ or JMS import
- A BPEL microflow calling a long-running BPEL or BPMN process for a request-response operation
- A BPEL microflow calling a message-binding import (such as an MQ or JMS import) for a request-response operation
When a synchronous-over-asynchronous invocation is detected, the following warning message is displayed in the SystemOut.log file:
000000ac Core W CWSCA2011W: SCA is switching a synchronous call to an asynchronous call. Request will be sent in a new local transaction. Default timeout is 115000 milliseconds.Depending on your specific application scenario, there are several approaches to avoiding a synchronous-over-asynchronous invocation. Many of these approaches are described in the article
Process implementation types: Patterns-based design for process-based solutions.
For example, if you have a microflow that invokes a long-running BPEL process over MQ for a request-response operation, you might want to incorporate a briefly persisted process to avoid a synchronous-over-asynchronous invocation. The use of briefly persisted processes is described in the "Briefly persisted process" section of the article.
For general information about invocation styles, see the Invocation styles topic.