There are three types of Java transactions

Source: Internet
Author: User

There are three types of Java transactions: JDBC Transaction, JTA (Java Transaction API) transaction, container transaction.

A normal transaction supports only one database connection and cannot span multiple databases. The default is to commit the transaction automatically, that is, each updated SQL statement on the database represents a transaction, the system automatically calls commit () after the operation succeeds, or rollback () is called to undo the transaction.

While XA transactions support access to and update data on two or more network computer resources that can be distributed across multiple databases, if you plan to define transactions with JTA, you need to have an implementation javax.sql.XADataSource, The JDBC driver for the javax.sql.XAConnection and Javax.sql.XAResource interfaces. A driver that implements these interfaces will be able to participate in the JTA transaction. A Xadatasource object is a factory of a Xaconnection object, using Usertransaction.begin (), Usertransaction.commit (), and Sertransaction.rollback () to operate

There are three types of Java transactions

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.