이 콘텐츠는 선택한 언어로 제공되지 않습니다.

Chapter 6. XA Transactions in Red Hat JBoss Fuse


Abstract

Red Hat JBoss Fuse provides a built-in global XA transaction manager, which applications can access if they need to coordinate transactions across multiple resources.

6.1. Transaction Architecture

Overview

Figure 6.1, “OSGi Transaction Architecture” shows an overview of the OSGi transaction architecture in Red Hat JBoss Fuse. The core of the architecture is a JTA transaction manager based on Apache Geronimo, which exposes various transaction interfaces as OSGi services.

Figure 6.1. OSGi Transaction Architecture

OSGi mandated transaction architecture

The JTA Transaction Services Specification section of the OSGi Service Platform Enterprise Specification describes the kind of transaction support that can (optionally) be provided by an OSGi container. Essentially, OSGi mandates that the transaction service is accessed through the Java Transaction API (JTA).
The transaction service exports the following JTA interfaces as OSGi services (the JTA services):
  • javax.transaction.UserTransaction
  • javax.transaction.TransactionManager
  • javax.transaction.TransactionSynchronizationRegistry
Only one JTA provider should be made available in an OSGi container. In other words, the JTA services are registered only once and the objects obtained by importing references to the JTA services must be unique.

Spring transaction integration

The JBoss Fuse transaction service exports the following Spring interface as an OSGi service:
  • org.springframework.transaction.PlatformTransactionManager
By obtaining a reference to the PlatformTransactionManager OSGi service, it is possible to integrate application bundles written using the Spring transaction API into the JBoss Fuse transaction architecture.

Red Hat JBoss Fuse transaction implementation

JBoss Fuse provides an OSGi-compliant implementation of the transaction service through the Apache Aries transaction feature, which consists mainly of the following bundles:
org.apache.aries.transaction.manager
org.apache.aries.transaction.wrappers
org.apache.aries.transaction.blueprint
Copy to Clipboard Toggle word wrap
The Aries transaction feature exports a variety of transaction interfaces as OSGi services (making them available to other bundles in the container), as follows:
  • JTA interfaces—the JTA UserTransaction, TransactionManager, and TransactionSynchronizationRegistry interfaces are exported, as required by the OSGi transaction specification.
  • Spring transaction interface—the Spring PlatformTransactionManager interface is exported, in order to facilitate bundles that are written using the Spring transaction APIs.
The PlatformTransactionManager OSGi service and the JTA services access the same underlying transaction manager.

Installing the transaction feature

To access the JBoss Fuse transaction implementation, you must install the transaction feature. In a standalone container, enter the following console command:
JBossFuse:karaf@root> features:install transaction
Copy to Clipboard Toggle word wrap
If you are deploying into a fabric, add the transaction feature to your application's profile.

Geronimo transaction manager

The underlying implementation of the JBoss Fuse transaction service is provided by the Apache Geronimo transaction manager. Apache Geronimo is a full implementation of a J2EE server and, as part of the J2EE implementation, Geronimo has developed a sophisticated transaction manager with the following features:
  • Support for enlisting multiple XA resources.
  • Support for 1-phase and 2-phase commit protocols.
  • Support for suspending and resuming transactions.
  • Support for automatic transaction recovery upon startup.
The transaction recovery feature depends on a transaction log, which records the status of all pending transactions in persistent storage.

Accessing Geronimo directly

Normally, the Geronimo transaction manager is accessed indirectly—for example, through the JTA wrapper layer or through the Spring wrapper layer. But if you need to access Geronimo directly, the following interface is also exposed as an OSGi service:
  • org.apache.geronimo.transaction.manager.RecoverableTransactionManager

HOWL transaction log

The implementation of the transaction log is provided by HOWL, which is a high speed persistent logger that is optimized for XA transaction logs.

JTA-based application bundles

Normally, it is recommended that application bundles access the transaction service through the JTA interface. To use the transaction service in a JTA-based application bundle, import the relevant JTA service as an OSGi service and use the JTA service to begin, commit, or rollback transactions.

Spring-based application bundles

If you have already implemented an application bundle using the Spring transaction API, you might find it more convenient to access the transaction service through the Spring API (represented by the PlatformTransactionManager Java interface). This means that you are able to deploy the same source code either in a pure Spring container or in an OSGi container, by changing only the configuration snippet that obtains a reference to the transaction service.

References

The following specifications are relevant to the transaction architecture in JBoss Fuse:
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat