If I am using Hibernate, then the hibernate transaction API and JTA at application server is for global transactions. If I am using JDBC, then the transaction management API is for JDBC. In both global and local transaction, we have to manage the transaction by ourselves. With local transaction, all the transaction code is within our code. Local Transactions: Local transactions happen between the application and a singled RDBMS, such as a simple JDBC connection. This is a complex process and requires knowledge at the application server level. JTA or java transaction API is required with the support of JNDI to lookup different databases, and the transaction manager decides the commit or rollback of the distributed transaction. The transaction manager cannot sit within the application to handle it, rather it sits in the application server level. This is called distributed transaction processing. Global Transactions: There can be applications (very unlikely) where the transaction can happen between different databases. We call it a rollback of all the steps in the transaction if anything fails in between. If one of them fails, the entire process fails. Here, the unit of work is money debiting from Account A and money crediting to Account B. annotation: Learn the usage of the annotation and a few caveats of it.Ī transaction is a logical unit of work that either completely succeeds or fails. Spring Transaction management: Understand Spring Transaction management in depth.Transaction management is a vast topic, hence I am dividing this article into two sections: This article will cover the Spring transaction management in detail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |