A Flexible Framework for Adding Transactions to Components

In this paper, we present a flexible framework for extending a component model with transactions. We first discuss key issues of combining components with transactions, and different approaches to achieve an appropriate level of transactional functionality in components. We distinguish between the explicit and implicit component participation approaches that differ by whether a component implements a part of transactional functionality or not. We discuss the influence of both approaches to concurrency control, recovery, and transaction context propagation. Then, we introduce our approach based on the interception pattern. We use several component controllers that manage transactional functionality on behalf of components. We identify several parts of transactional functionality that are implemented by different transactional controllers. For a component, to be transactional, the only requirement is to fulfill a component contract which is specific to various transactional controller implementations. We provide an overview of a prototype implementation of our approach in the Fractal component model. Thanks to the flexibility and reflective nature of Fractal, it is possible to achieve different levels of component transactional functionality by combining different transactional controllers, with only taking their component contracts into account. Our work proves that with an appropriate component framework that supports reflection and flexible component management with clearly defined notions of component composition, lifecycle, and binding, we can add transactions to components in an elegant and flexible way.