此内容没有您所选择的语言版本。

29.2. Configure Transactions


29.2.1. Configure Transactions (Library Mode)

In Red Hat JBoss Data Grid, transactions in Library mode can be configured with synchronization and transaction recovery. Transactions in their entirety (which includes synchronization and transaction recovery) are not available in Remote Client-Server mode.
In order to execute a cache operation, the cache requires a reference to the environment's Transaction Manager. Configure the cache with the class name that belongs to an implementation of the TransactionManagerLookup interface. When initialized, the cache creates an instance of the specified class and invokes its getTransactionManager() method to locate and return a reference to the Transaction Manager.
In Library mode, transactions are configured as follows:

Procedure 29.1. Configure Transactions in Library Mode (XML Configuration)

<local-cache name="default" <!-- Additional configuration information here -->>
	<transaction mode="BATCH"
	    stop-timeout="60000"
	    auto-commit="true"
	    protocol="DEFAULT"
	    recovery-cache="recoveryCache">
	<locking <!-- Additional configuration information here --> >
	<versioning versioningScheme="SIMPLE"/>
  <!-- Additional configuration information here -->
</local-cache>
Copy to Clipboard Toggle word wrap
  1. Enable transactions by defining a mode. By default the mode is NONE, therefore disabling transactions. Valid transaction modes are BATCH, NON_XA, NON_DURABLE_XA, FULL_XA.
  2. Define a stop-timeout, so that if there are any ongoing transactions when a cache is stopped the instance will wait for ongoing transactions to finish. Defaults to 30000 milliseconds.
  3. Enable auto-commit, so that single operation transactions do not need to be manually initiated. Defaults to true.
  4. Define the commit protocol in use. Valid commit protocols are DEFAULT and TOTAL_ORDER.
  5. Define the name of the recovery-cache, where recovery related information is kept. Defaults to __recoveryInfoCacheName__.
  6. Enable versioning of entries by defining the versioningScheme attribute as SIMPLE. Defaults to NONE, indicating that versioning is disabled.

29.2.2. Configure Transactions (Remote Client-Server Mode)

Red Hat JBoss Data Grid does not offer transactions in Remote Client-Server mode. The default and only supported configuration is non-transactional, which is set as follows:

Example 29.1. Transaction Configuration in Remote Client-Server Mode

<cache>
	<!-- Additional configuration elements here -->
 	<transaction mode="NONE" />
	<!-- Additional configuration elements here -->
</cache>
Copy to Clipboard Toggle word wrap
返回顶部
Red Hat logoGithubredditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat