Java EE and .NET Interoperability: Integration Strategies, Patterns, and Best Practices
The following recapitulates some best practices and pitfalls regarding the interoperability of managing transactions using Java EE and .NET platforms. Performance and Scalability
A common 2PC might cause a performance overhead if the 2PC is used with a pessimistic locking. Individual resources hold a lock on a record for the duration of the transaction and prevent access to these records by other requests. In this scenario, multiple requests to the same product will not be successful because during the execution of the Inventory look-up call, that product record has to be locked to check availability and decrement its quantity. Therefore, an application architect has to make provision for data availability when addressing data integrity risks. In some cases an optimistic locking can be used in lieu of a pessimistic lock. Alternatively, a compensation-based approach can eliminate locking overhead. It is important to specify measurable Service Level Agreements (SLAs) when establishing the application integration criteria. In a purchase order example, the product availability lookup and the counter decrement should not take more than a few milliseconds, particularly when the integration occurs on an internal network. Similarly, throughput parameters may need to be available to ensure that the flow of requests does not cause a bottleneck. Security
A Purchase Order application has to "trust" the Inventory application to perform a product availability check on its behalf. Along the same line, an Inventory application has to be authorized to make an Inventory call and access the underlying resources. From a best practices standpoint, it is important to ensure an adequate level of trust among all parties participating in a distributed transaction. Reliability
Distributed transactions often have to be interoperable with the reliable messaging mechanism. In this chapter's example, the .NET Inventory Check service may require reliability to guarantee delivery of the request. Therefore, when assessing requirements it is imperative to make provision for reliability when selecting a distributed communication technology. |
Категории