Document Information

Preface

Part I Introduction

1.  Overview

2.  Using the Tutorial Examples

Part II The Web Tier

3.  Getting Started with Web Applications

4.  Java Servlet Technology

5.  JavaServer Faces Technology

6.  Introduction to Facelets

7.  Using JavaServer Faces Technology in Web Pages

8.  Developing with JavaServer Faces Technology

9.  Configuring JavaServer Faces Applications

Part III Web Services

10.  Introduction to Web Services

11.  Building Web Services with JAX-WS

12.  Building RESTful Web Services with JAX-RS and Jersey

Part IV Enterprise Beans

13.  Enterprise Beans

14.  Getting Started with Enterprise Beans

15.  Running the Enterprise Bean Examples

Part V Persistence

16.  Introduction to the Java Persistence API

17.  Running the Persistence Examples

18.  The Java Persistence Query Language

Part VI Security

19.  Introduction to Security in the Java EE Platform

20.  Using Java EE Security

21.  Securing Java EE Applications

22.  Securing Web Applications

Part VII Java EE Supporting Technologies

23.  Introduction to Java EE Supporting Technologies

What Is a Transaction?

Container-Managed Transactions

Transaction Attributes

Required Attribute

RequiresNew Attribute

Mandatory Attribute

NotSupported Attribute

Supports Attribute

Never Attribute

Summary of Transaction Attributes

Setting Transaction Attributes

Rolling Back a Container-Managed Transaction

Synchronizing a Session Bean's Instance Variables

Methods Not Allowed in Container-Managed Transactions

Bean-Managed Transactions

JTA Transactions

Returning without Committing

Methods Not Allowed in Bean-Managed Transactions

Transaction Timeouts

Updating Multiple Databases

Transactions in Web Components

25.  Resource Connections

Index

 

Chapter 24

Transactions

A typical enterprise application accesses and stores information in one or more databases. Because this information is critical for business operations, it must be accurate, current, and reliable. Data integrity would be lost if multiple programs were allowed to update the same information simultaneously. It would also be lost if a system that failed while processing a business transaction were to leave the affected data only partially updated. By preventing both of these scenarios, software transactions ensure data integrity. Transactions control the concurrent access of data by multiple programs. In the event of a system failure, transactions make sure that after recovery the data will be in a consistent state.