什么是全球交易? [英] What is a global transaction?

查看:137
本文介绍了什么是全球交易?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

JSR 907 JTA 1.2 定义全球交易术语:

JSR 907 JTA 1.2 defines the "global transaction" term:


UserTransaction.begin方法启动全局事务
将事务与调用线程关联。

The UserTransaction.begin method starts a global transaction and associates the transaction with the calling thread.



<这是什么意思?它是最外层的事务还是什么?

What does that mean? Is it the outermost transaction or what?

推荐答案

基本上,本地事务和全局事务之间的区别是资源限制的。
全局事务将跨越多个资源。本地事务仅限于一个资源/数据源。

Basically the difference between a local transaction and a global transaction is resource bound. A global transaction will span multiple resources. A local transaction is limited to one resource/datasource.

例如。

在全局事务中,您将写入数据库并通过队列发送消息。

In a global transaction you will write to the DB and send a message over a queue.

这里很好地解释了:
http://integrationspot.blogspot.co.uk/2011/03/jta-transactions-local-and-global.html


全局交易(XA)

当托管数据源是为全局事务配置,
返回可以参与全局事务的连接。
全局事务(也称为分布式事务)在事务中使用
多个资源。

When a managed data source is configured for global transactions, it returns connections that can participate in global transactions. A global transaction (also called a distributed transaction) enlists more than one resource in the transaction.

全局事务提供了使用的能力多个
交易资源(通常是关系数据库和消息
队列)。

Global Transactions provide the ability to work with multiple transactional resources (typically relational databases and message queues).

这篇关于什么是全球交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆