Download PDF (1.3 MB) - IBM Redbooks
Download PDF (1.3 MB) - IBM Redbooks
Download PDF (1.3 MB) - IBM Redbooks
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
3.2.4 Business object parsing mode considerations<br />
This section describes how and why to choose the BO parsing mode. Two options for this<br />
mode exist: eager parsing mode and lazy parsing mode.<br />
Overview<br />
WebSphere Business Process Manager V7.0.0.1 introduced BO lazy parsing mode. In this<br />
mode, when BOs are created. their properties are not populated until they are accessed by<br />
the application. Also, when reading XML input, the stream is incrementally parsed and its<br />
properties do not materialize until they are accessed.<br />
In contrast, with eager parsing mode, the input XML stream is immediately and fully parsed<br />
(with some exceptions for specific mediation primitives) and materializes into a complete<br />
in-memory data object representation.<br />
Lazy parsing uses the XML Cursor Interface (XCI) implementation of Service Data Objects<br />
(SDOs), provided by the WebSphere Application Server Feature Pack for Service Component<br />
Architecture (SCA), which is delivered as part of Business Process Manager V8.0. In this<br />
mode, the input XML stream remains in memory throughout the lifetime of the corresponding<br />
BO. The cursor-based XML parser creates nodes in memory only when the nodes are<br />
traversed. Properties and attributes are evaluated only when the application requests them.<br />
Parsing the XML stream in this fashion delivers better performance than complete parsing for<br />
many applications in eager mode. This improvement is especially evident if only a small<br />
portion of the BO is accessed during the application execution.<br />
Lazy parsing also reuses the XML stream when BOs are serialized, for example, for outbound<br />
service calls. The result is faster serialization because serializing the entire in-memory BO<br />
into XML strings is not necessary. Lazy parsing automatically detects namespaces in the<br />
output stream that differ from the namespaces in the original input stream, and corrects them.<br />
This form of serialization is used for all bindings and internal Business Process Manager<br />
runtime components, such as the Business Process Choreographer (BPC) container, and<br />
when custom code calls BO serialization.<br />
To further optimize performance, lazy parsing also employs a technology referred to as<br />
copy-on-write, where properties in BOs are lazily copied. When the copy operation initially<br />
takes place, the target BO points only to the node tree of the source BO. Lazy parsing copies<br />
no properties. Subsequent modifications of either the source or target BO trigger a split of the<br />
affected node in the BO tree, copying BO properties only as needed. Modifications occur in<br />
the local copy of the corresponding node. Copy-on-write is transparent to the application.<br />
Setting parsing mode<br />
In Business Process Manager V8.0, the default parsing mode is the lazy mode for newly<br />
developed applications in Integration Designer V8.0. Applications moved from WebSphere<br />
Process Server V7.0.0.3 and earlier releases continue to run in the eager parsing mode.<br />
However, for these older applications, you can manually enable lazy parsing mode through<br />
Integration Designer, which provides a property for each module and library to configure the<br />
XML parsing mode to either eager or lazy.<br />
Figure 3-5 on page 31 shows the Integration Designer panel that the system displays during<br />
creation of a library. At this point, you can specify whether it can be included in an eager<br />
parsing or lazy parsing module, or both. The default is set to lazy parsing when the library is<br />
initially created. When both parsing modes are selected for the library, the module in which<br />
the library is located determines the actual parsing mode at run time.<br />
30 <strong>IBM</strong> Business Process Manager V8.0 Performance Tuning and Best Practices