`

XA and NON-XA

 
阅读更多

Xa resource is used where there is a distributed transaction is required.
==============================================
According to my knowledge XA drivers are used for globule transaction..and non XA drivers are used for local transaction..
========================================================================

XA : its basically when you have to use a two-phase commit , An XA transaction, in the most general terms, is a "global transaction" that may span multiple resources.

So this would mean for eg if there are two DB which needs to be commited at the same 
time .. so in this case you would use an XA drivers

connection Pool : 

The reason for using connection pool is ...Opening and maintaining a database connection 
for each user, especially requests made to a dynamic database-driven website application, 
is costly and wastes resources. So to avoid this the connection pool uses a cache of 
database connections maintained so that the connections can be reused when future 
requests to the database are required.

=====================================================================

XA:

An XA transaction, in the most general terms, is a "global transaction" that may span multiple resources. An XA transaction involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global transaction. 

XA transactions come from the X/Open group specification on distributed, global transactions. JTA includes the X/Open XA spec, in modified form. 

XA gets involved when you want to work with multiple resources - 2 or more databases, a database and a JMS connection, all of those plus maybe a JCA resource - all in a single transaction. In this scenario, you'll have an app server like Websphere or Weblogic or JBoss acting as the Transaction Manager, and your various resources (Oracle, Sybase, IBM MQ JMS, SAP, whatever) acting as transaction resources. Your code can then update/delete/publish/whatever across the many resources. When you say "commit", the results are commited across all of the resources. When you say "rollback", _everything_ is rolled back across all resources. 

The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources. 

In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. 

NON-XA:

A non-XA transaction always involves just one resource.
Non-XA transactions have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions).  

Most stuff in the world is non-XA - a Servlet or EJB or plain old JDBC in a Java application talking to a single database.


A non-XA datasource generally can't participate in a global transaction (sort of - some people implement what's called a "last participant" optimization that can let you do this for exactly one non-XA item).


============================================

An XA transaction, in the most general terms, is a "global transaction" that may span multiple resources. A non-XA transaction always involves just one resource. 

An XA transaction involves a coordinating transaction manager, with one or more databases (or other resources, like JMS) all involved in a single global transaction. Non-XA transactions have no transaction coordinator, and a single resource is doing all its transaction work itself (this is sometimes called local transactions).

Most of the time we use non-XA - a Servlet or EJB or plain old JDBC in a Java application talking to a single database. XA gets involved when you want to work with multiple resources - 2 or more databases, a database and a JMS connection, all of those plus maybe a JCA resource - all in a single transaction. Here, Weblogic will be acting as the Transaction Manager, and your various resources (Oracle, Sybase, IBM MQ JMS, SAP, whatever) acting as transaction resources. Your code can then update/delete/publish/whatever across the many resources. When you say "commit", the results are commited across all of the resources. When you say "rollback", _everything_ is rolled back across all resources.

The Transaction Manager coordinates all of this through a protocol called Two Phase Commit (2PC). This protocol also has to be supported by the individual resources.

In terms of datasources, an XA datasource is a data source that can participate in an XA global transaction. A non-XA datasource generally can't participate in a global transaction (sort of - some people implement what's called a "last participant" optimization that can let you do this for exactly one non-XA item).
分享到:
评论

相关推荐

    spring-boot-reference.pdf

    37.5. Mixing XA and Non-XA JMS Connections 37.6. Supporting an Alternative Embedded Transaction Manager 38. Hazelcast 39. Quartz Scheduler 40. Spring Integration 41. Spring Session 42. Monitoring and ...

    Python 字符串处理特殊空格\xc2\xa0\t\n Non-breaking space

    今天遇到一个问题,使用python的find函数寻找字符串中的第一个空格时没有找到正确的位置,下面是解决方法,需要的朋友可以参考下

    Atomikos3.9官方包文档以及实例

    l 内置的JMS适配器XA-capable JMS队列连接器 注释:JMS:jms即Java消息服务(Java Message Service)应用程序接口是一个Java平台中关于面向消息中间件(MOM)的API,用于在两个应用程序之间,或分布式系统中发送消息...

    PHP mb_convert_encoding 获取字符串编码类型实现代码

    : [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2} # straight 3-byte

    php下检测字符串是否是utf8编码的代码

    function is_utf8($string) { ...: [\x09\x0A\x0D\x20-\x7E] # ASCII | [\xC2-\xDF][\x80-\xBF] # non-overlong 2-byte | \xE0[\xA0-\xBF][\x80-\xBF] # excluding overlongs | [\xE1-\xEC\xEE\xEF][\x

    TUXEDO与ORACLE数据库的互连[参考].pdf

    TUXEDO与ORACLE数据库的互连[参考].pdf

    动手学深度学习-学习笔记(四)

    本文的主要内容有:机器翻译及相关技术;注意力机制与Seq2seq模型;Transformer。...而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出

    神经机器翻译技术、Attention与Seq2Seq、Transformer

    而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出gbk编码范围,是需要去除的特殊字符。 大小写转换 分词 把字符串转换成单词组成的列表list 建立词典 ...

    机器翻译及相关技术笔记

    而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出gbk编码范围,是需要去除的特殊字符。再数据预处理的过程中,我们首先需要对数据进行清洗。 二、注意

    深度学习PyTorch入门(四)

    机器翻译 机器翻译(MT): 将一段文本从一种语言自动翻译为...而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出gbk编码范围,是需要去除的特殊字符。再数

    动手学深度学习 Task04 机器翻译及相关技术;注意力机制与Seq2seq模型;Transformer

    【一】机器翻译及相关技术 机器翻译(MT): 将一段文本从一种语言自动翻译为... 而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出gbk编码范围,是需要去除

    机器翻译笔记

    而 \xa0 属于 latin1 (ISO/IEC_8859-1)中的扩展字符集字符,代表不间断空白符nbsp(non-breaking space),超出gbk编码范围,是需要去除的特殊字符。再数据预处理的过程中,我们首先需要对数据进行清洗。 分词 字符...

    uboott移植实验手册及技术文档

    cmp r3, #0xa blt nand1 nand2: ldr r2, [r1, #oNFSTAT] @ wait ready tst r2, #0x1 beq nand2 ldr r2, [r1, #oNFCONF] orr r2, r2, #0x800 @ disable chip str r2, [r1, #oNFCONF] @ get read to ...

    springboot参考指南

    混合XA和non-XA的JMS连接 v. 32.5. 支持可替代的内嵌事务管理器 xii. 33. Spring集成 xiii. 34. 基于JMX的监控和管理 xiv. 35. 测试 Spring Boot参考指南 4 i. 35.1. 测试作用域依赖 ii. 35.2. 测试Spring应用 iii....

    java 面试题 总结

    &是位运算符,表示按位与运算,&&是逻辑运算符,表示逻辑与(and)。 11、HashMap和Hashtable的区别。 HashMap是Hashtable的轻量级实现(非线程安全的实现),他们都完成了Map接口,主要区别在于HashMap允许空...

    容错服务器的介绍.pptx

    全球两大容错服务器制造商 80 02 90 MIPS / Server Net / Non Stop S Series 1997年被 康柏收购 2002年被 合并入惠普 Motorola / VOS Intel / VOS UNIX OS / FTX XA/R860 97 RISC / HP PA/HP UX/ Continuum 95 ...

    NTFS Documentation

    Attribute - $INDEX_ALLOCATION (0xA0) .................................................... 28 12. Attribute - $BITMAP (0xB0) ...........................................................................

    超级有影响力霸气的Java面试题大全文档

    &是位运算符,表示按位与运算,&&是逻辑运算符,表示逻辑与(and)。 14、HashMap和Hashtable的区别。 HashMap是Hashtable的轻量级实现(非线程安全的实现),他们都完成了Map接口,主要区别在于HashMap允许空...

    Oracle9i的init.ora参数中文说明

    ), interpreted (然后 PL/SQL 模块将被编译为 PL/SQL 字节代码格式), debug (PL/SQL 模块将用探测调试符号来编译), non_debug。 默认值: " interpreted, non_debug " plsql_native_linker: 说明: 此参数指定链接...

Global site tag (gtag.js) - Google Analytics