Comments
Richard Davies wrote: The UK has a good crop of technology pioneers in cloud computing - for example ElasticHosts, FlexiScale, Flexiant, OnApp - and also some strong government initiatives such as G-Cloud. We will have to see whether this kind of technical leadership converts into swift mass-market adoption or not.
Cloud Expo on Google News

SYS-CON.TV
Cloud Expo & Virtualization 2009 East
PLATINUM SPONSORS:
IBM
Smarter Business Solutions Through Dynamic Infrastructure
IBM
Smarter Insights: How the CIO Becomes a Hero Again
Microsoft
Windows Azure
GOLD SPONSORS:
Appsense
Why VDI?
CA
Maximizing the Business Value of Virtualization in Enterprise and Cloud Computing Environments
ExactTarget
Messaging in the Cloud - Email, SMS and Voice
Freedom OSS
Stairway to the Cloud
Sun
Sun's Incubation Platform: Helping Startups Serve the Enterprise
POWER PANELS:
Cloud Computing & Enterprise IT: Cost & Operational Benefits
How and Why is a Flexible IT Infrastructure the Key To the Future?
Click For 2008 West
Event Webcasts
Interfacing Transaction Services: Part 2
Interfacing Transaction Services: Part 2

Undoubtedly, the support for distributed transactions is a part of any enterprise system. Part One of this series (JDJ, March 1998) explored the X/Open Distributed Transaction Processing (DTP) Model - a common model for distributed transaction processing. We also explained the concepts of Microsoft Transaction Server (MTS) that quickly become de facto standard for developing business components on the Windows platform. We demonstrated how to write "first-class" MTS COM components in Java. The described process of creating these components has been greatly simplified by the release of Microsoft Visual J++ 6.0.

In this second part we will take a closer look at CORBA Object Transaction Service (OTS). As Java gains wider acceptance in enterprise computing, we are likely to see a number of simplified object models and API layers that will rely on OTS to provide transaction support (e.g., EJB, Java Transaction Service, IBM's San Francisco Project, etc.). These models greatly reduce the amount of code necessary to create applications with full transaction support. Nevertheless, as the number of components in the system increases, the complexities of real-world systems are often encountered. These include managing object interdependencies, state and context management, and dealing with various hardware and network limitations. To make the situation worse, the problems often go undetected until the deployment time because of insufficient prototype evaluation and stress testing. In solving these issues, an understanding of the underlying CORBA specification and implementations is critical. Therefore, we will describe in this article the fundamentals of CORBA OTS specification as defined by Object Management Group (OMG). We will also show some details of CORBA OTS commercial implementations and discuss the relationship between CORBA OTS and EJB. CORBA Object Transaction Service Specification

CORBA OTS specification is loosely based on X/Open DTP Model. The specification defines a model that complies with ACID transaction properties: atomicity, consistency, isolation and durability. The specification also describes the set of standard interfaces and behaviors that define how a client, the Transaction Service and the transactional objects participate in transaction processing. Figure 1 illustrates the main entities of CORBA OTS.

In simple view, the client starts a transaction by contacting the Transaction Service. The service creates a transaction context for the new transaction. The client then makes a series of requests on transactional and nontransactional objects. The transactional objects that maintain durable data and state are called recoverable objects. These objects must register with the Transaction Service using a resource object. The resource object participates in coordinating a two-phase commit process, and is used to access the underlying resources consumed by the objects. When finished, the client commits or rolls back the changes by instructing the Transactional Service to commit or roll back, respectively. The service then coordinates the two-phase commit process with all resources registered within the scope of the current transaction. Listing 1 shows the definitions of all OTS-defined data types and interfaces in Interface Definition Language (IDL).The CORBA OTS specification defines two basic approaches to carrying out transaction processing. These are based on the level of involvement in the context management and transaction propagation. The context management refers to the process of the transaction context creation, initialization and control. In general, the participants can choose the indirect context management and rely on the Transaction Service to perform all context-related responsibilities. On the other hand, the client can elect to manage the transaction context directly by using the set of standard OTS interfaces. Similarly, when creating transactional objects, the client can use the Transaction Service implicit propagation, or explicitly pass the transaction context to the objects. Clearly, there are four possible combinations of how to perform the context management and transaction propagation:

  • Indirect context management and implicit propagation
  • Indirect context management and explicit propagation
  • Direct context management and implicit propagation
  • Direct context management and explicit propagation

    While all of these combinations are valid, the ones described in the following sections are the most common. These two combinations reflect the fundamental design tradeoff between ease of use and flexibility.

    Indirect Context Management and Implicit Transaction Propagation
    When using the indirect context management and the implicit transaction propagation, we rely on the Transaction Service to perform all context-related responsibilities. This model requires the simplest code by utilizing a predefined standard pseudo object Current. The client uses the Current object to begin, commit or roll back the transaction. The client also instantiates and uses the recoverable objects as any other CORBA objects. Upon object creation, the transaction context is automatically associated with the server thread by the Transaction Service. The recoverable objects can be marked as "transactional" at design time by implementing the TransactionalObject interface. This interface does not have any methods -- it simply signals that all of the object's methods are transactional, and the service should propagate the transaction context to the object implicitly. The server object can also implement the Resource interface. This indicates that the object is recoverable and it is capable of participating in the two-phase commit process.Figure 2 depicts the typical scenario in which both the client and the recoverable object use the Current pseudo objects. The client starts the transaction by calling Current.begin() method. It then performs the series of operations on the server objects. When finished, the client issues Current.commit() or Current.rollback() commands to commit or roll back the current transaction, respectively. On the server side, the recoverable object retrieves the Control object by calling Current.get_control(). The Control object in turn is used to obtain the Coordinator object. The Coordinator object provides an access to the single transaction information such as the transaction name, transaction status, parent transaction and the propagation context. The recoverable objects use the Coordinator object to register its resources with the current transaction by calling Coordinator.register_resource(), which returns the RecoveryCoordinator object. The resources use this object when recovering from the failure after being previously prepared. Finally, the recoverable object carries out the client's request.

    At the client's request, the Transaction Service commits the changes through the two-phase commit process with all registered resources. When the client requests to commit the transaction, the Coordinator issues the Resource.prepare() command. The resources then prepare to commit and return the Vote object accordingly: VoteCommit, VoteRollback or VoteReadOnly. The VoteReadOnly indicates that no changes were made to the underlying persistent data managed by the resource. If all registered resources voted VoteReadOnly, the Coordinator informs the client about the successful commit. If at least one resource replied VoteCommit and the rest of the registered resources voted VoteReadOnly, the Coordinator first saves the current transaction information in case of later failure, and then completes the two-phase commit process by calling Resource.commit().

    Direct Context Management and Explicit Transaction Propagation
    The direct context management allows the clients to access the transaction context directly by using TransactionFactory, Control and Terminator interfaces. The client starts the new transaction by calling TransactionFactory.create() method. This call returns the Control object, which is used to retrieve references to the Terminator and Coordinator objects. The client subsequently performs calls on transactional objects. The client explicitly passes the reference to the Control object as a method parameter. To finish the current transaction, the client uses the Terminator.commit() method. Upon the request to commit, the OTS will initiate the two-phase commit process with all of the registered resources as described in the previous section.

    The server objects do not have to implement TransactionalObject interface. Instead, these objects receive the reference to the Control object as an explicit parameter for each method. This allows the same object to have both transactional and nontransactional methods. All transactional methods must use the passed-in Control object to retrieve the reference to the Coordinator object and register all their resources. Figure 3 illustrates how the client and the recoverable server engage in transaction processing using the direct context management and explicit transaction propagation.

    Nested Transactions and X/Open Interoperability
    Although the X/Open DTP model does not define the nested transactions, the Transaction Service supports this model of transaction processing. The nested transactions are implemented by establishing a parent-child relationship among transactions and thus building so-called transaction families. The transaction family comprises one top-level transaction and one or more subtransactions. The subtransactions can be nested. A transaction will not commit until all subtransactions are committed. Similarly, the changes committed by the subtransactions could be rolled back by ancestor transactions. The nested transactions prove useful in optimizing system performance. By isolating failures in subtransactions, rollbacks and resource recovery are kept to minimum.

    The specification also establishes guidelines for integrating with X/Open compliant systems. In particular, transactions can be imported and exported across the two models. The OTS implementations should allow XA-compliant resource managers to participate directly in OTS transactions. The OTS specification explicitly allows a single transaction service to support both X/Open DTP and OTS models. This decision not to engage in "purist" arguments will certainly prove critical to the specification's success with vendors and customers. The transaction monitor vendors can leverage their experience with X/Open and incrementally add OTS support onto the existing products (e.g., IBM TXSeries Transaction Server). On the other hand, users can easily integrate their "legacy" systems with the new CORBA-compliant applications.

    CORBA OTS Implementations
    While the service specification defines a set of standard interfaces and scenarios, ORB vendors provide the actual implementations of the service. Contrary to popular belief, the common specification and language mapping do not necessarily lead to interchangeable implementations. While this allows vendors to differentiate their products, it also causes significant problems when porting server objects across different ORBs. Object Management Group recognized the problem and defined the set of interfaces for porting the Transaction Service across various ORBs (CosTSPortability module). The service portability is achieved by defining specific interfaces that lie between the ORB and the Transaction Service. While this model virtually guarantees the portability of the service, using the same vendor's ORB and CORBAservices is still the safest and most practical decision.From the user's standpoint, implementing CORBA solutions can be greatly simplified by leveraging a complete CORBA "suite" that usually allows for easy integration of CORBAservices, transaction monitor, server utilities, common IDE and possibly a set of classes for simpler client-side programming. For example, in addition to the implementation of standard CORBAservices, Iona's Orbix Object Transaction Monitor (OrbixOTM) also offers a set of GUI development tools, server-side manager with SMTP support, fault "resilience" and server load balancing. As CORBA matures, we are likely to see more of these complete-suite products, which will help to push CORBA further into the enterprise mainstream.

    On the Java side, OMG provides a standard Java mapping of IDL data types, modules and other constructs. It also offers details on server-side mapping of transient and persistent objects, Java ORB portability and mapping of CORBA pseudo objects into Java. JDK 1.2 contains a great example of this mapping -- an implementation of CORBA 2.0-compliant ORB and CORBA Naming service.

    In addition to JDK 1.2, the release of the Java Transaction Service (JTS) and Enterprise JavaBeans (EJB) specifications further strengthened the bond between CORBA and Java. These technologies also helped to clear up some of the confusion over the relationship of CORBA and the Java platform.

    EJB was designed to provide a high-level component architecture for writing business applications. In general, the enterprise bean object can use automatic declarative transaction management by specifying a transaction attribute. The bean container interposes all client requests, and the container is then responsible for managing the transaction according to the transaction attribute. EJB defines valid values for the bean transaction attribute (TX_NOT_SUPPORTED, TX_BEAN_MANAGED, TX_REQUIRED, TX_SUPPORTS, and TX_REQUIRES_NEW) that are very similar to Microsoft MTS transaction attributes. For example, the bean marked TX_ REQUIRED will execute in the client's transaction context, if the client has one. Otherwise, the new transaction is automatically created. The bean can also choose to use manual transaction management by specifying TX_BEAN_MANAGED attribute. Under this scenario, the clients and the beans use the JTS javax.jts.UserTransaction interface (see Listing 2) to directly manage the transaction. In fact, UserTransaction interface is the only JTS interface that the bean container must provide to be EJB compliant.

    The JTS specification defines a standard transaction management API for the Java platform. It includes org.omg.CosTransactions and org.omg.CosTSPortability packages that contain the standard Java mapping of the CORBA OTS modules. As mentioned before, the JTS also defines a high-level application transaction "demarcation" API (javax.jts package). Since this API provides an isolation layer between the enterprise beans and the service implementation, in theory any transaction manager exposing this API can participate in the EJB model.

    Conclusion
    In order to develop enterprise business components in Java, we need to provide support for distributed transaction processing. The X/Open DTP model defines the set of standard interfaces and behaviors for implementing distributed transactions. On the Windows platform, it is Microsoft Transaction Server that provides COM components with common services, such as resource management, object pooling and the DTP-like transaction model.

    The CORBA Object Transaction Service offers an alternative model for two-phase commit transactions. The OTS specification describes how the clients, transactional objects, resources and the OTS participate in transaction creation, context management, transaction propagation and two-phase commit protocol. In addition to the flat transaction model, the Transaction Service provides support for nested transactions. While a variety of OTS commercial implementations are available, their success will often be determined by features like transaction monitor, CORBA server management and productivity tools, and ease of integration with "legacy" X/Open DTP-based applications.

    With the release of JDK 1.2, Java Transaction Service and Enterprise JavaBeans specifications, CORBA and Java platform integration has never been better. EJB provides necessary higher-level abstractions for creating business components in Java. At the same time, EJB relies on technologies like CORBA to provide the underlying service implementation. As a result, understanding of CORBA, CORBAservices and CORBA OTS in particular will prove to be essential for building large business systems in Java.

    References and Resources
    Arnold, K., and Gosling, J., "The Java Programming Language," Addison-Wesley, Reading, MA, 1996.
    "Distributed TP: XA Specification, X /Open Document C193," X/Open Company Ltd., Reading, UK, 1992.
    "Enterprise JavaBeans, Version 1.0," Sun Microsystems, Palo Alto, CA, March 1998. "OrbixOTS Administrator's and Programmer's Guide," IONA Technologies PLC, Cambridge, MA, 1997.
    "OrbixOTM Guide," IONA Technologies PLC, Cambridge, MA, 1997.
    "Transaction Service Specification: Version 1.1," Object Management Group, November 1997.
    "White paper - The Object Transaction Service," IONA Technologies PLC, Cambridge, MA, 1997.

    About Maros Cunderlik
    Maros Cunderlik is a lead consultant with 3M. He focuses on applications design and distributed object architectures.

  • In order to post a comment you need to be registered and logged in.

    Register | Sign-in

    Reader Feedback: Page 1 of 1

    Latest Cloud Developer Stories
    Swisscom, the Swiss telecom, is going into the cloud business. Its subsidiary Swisscom IT Services AG has signed up with Red Hat as a Certified Cloud Provider and launched a public cloud Infrastructure-as-a-Service (IaaS) cloud targeting enterprise-class customers primarily in ...
    Apache Deltacloud, the Red Hat-contributed ReSTful API that abstracts differences between clouds so services on any cloud can be managed – provided of course there’s a driver – has graduated from the Apache Foundation’s incubator and is now a full-fledged Top-Level Project (TLP)....
    In a surprise move on Tuesday, January 10, Oracle wheeled out its Big Data Appliance. That’s the one it said in October would be ready sometime in the first half. Only nobody believed it meant early in the first half. Heck, it’s not even clear anybody thought Oracle could make ...
    Rackspace Hosting, the service leader in cloud computing, on Thursday announced its acquisition of SharePoint911, an industry leader in SharePoint consulting, training, and "JumpStart" services within SharePoint. The unification of both companies provides capabilities to deliver ...
    CloudLinux, Inc., on Thursday released CafeFS 3, a virtualized file system for shared hosters that cages each customer within its own virtualized file system. CageFS becomes part of CloudLinux OS at no additional charge. CloudLinux OS, the only commercially-supported Linux OS m...
    Subscribe to the World's Most Powerful Newsletters
    Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
    Click to Add our RSS Feeds to the Service of Your Choice:
    Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
    myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
    Publish Your Article! Please send it to editorial(at)sys-con.com!

    Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

    SYS-CON Featured Whitepapers
    ADS BY GOOGLE

    Breaking Cloud Computing News

    BEACHWOOD, Ohio, Feb. 16, 2012 /PRNewswire/ -- DDR Corp. (NYSE: DDR) today announced operating re...