Java Transaction API (JTA) Overview Help

拥有回忆 提交于 2019-12-21 09:21:50

问题


Can someone give me a good explanation on the motivation and application of JTA in modern Java applications? I don't want overly technical details. But just a paragraph on why do we need JTA, what does JTA accomplish, and maybe a piece of pseudo code showing how JTA is being used?


回答1:


JTA defines the semantics (specification + API) of the orchestration that allows for 3rd party enterprise information systems and your application to exchange information with integrity.

JTA Specification. Introduction pretty much sums it up.




回答2:


Normally, an application performs transactional operations over information resources like Database, JMS etc. As these transactions are totally isolated from each other, it can happen that the application is able to commit one transaction on one resource, but on the other one it fails. It would lead to information inconsistency among these resources, as one got committed and the other not.

XA is an open standard to such a problem. And, JTA is the name given to XA in the J2EE world.

Hope that helps.

Nitin




回答3:


Greatest book about JTA. Java Transaction Design Strategies By Mark Richards

You can find here a lot of basics about JTA, transactions, XA, Spring, EJB support. Good explanation about all aspects of programming and designing transactional application. Recommend.




回答4:


JTA allows you to write code or systems having multiple transactional resources: databases, message queues, your own custom resource, or resources accessed from multiple processes, perhaps on multiple hosts, as participants in a single transaction.




回答5:


This has a fairly nice explanation of what JTA is: http://www.roseindia.net/interviewquestions/j2ee-interview-questions-2.shtml

To learn more you can look at the link at the top of this page, the pdf version of the tutorial. As you search for JTA you will find code for JTA. http://docs.sun.com/app/docs/doc/819-3669/bnciz?a=view




回答6:


JTA allows us to write code which having multiple transaction with resources, databases and resources accessed from multiple processes as participants in a single transaction.



来源:https://stackoverflow.com/questions/1647844/java-transaction-api-jta-overview-help

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!