12.11.2014 Views

web server - Borland Technical Publications

web server - Borland Technical Publications

web server - Borland Technical Publications

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter<br />

19<br />

Chapter19Transaction management<br />

Important<br />

This chapter describes how to handle transactions.<br />

For documentation updates, go to http://www.borland.com/techpubs/bes.<br />

Understanding transactions<br />

Application programmers benefit from developing their applications on platforms such<br />

as Java 2 Enterprise Edition (J2EE) that support transactions. A transaction-based<br />

system simplifies application development because it frees the developer from the<br />

complex issues of failure recovery and multi-user programming. Transactions are not<br />

limited to single databases or single sites. Distributed transactions can simultaneously<br />

update multiple databases across multiple sites.<br />

A programmer typically divides the total work of an application into a series of units.<br />

Each unit of work is a separate transaction. As the application progresses, the<br />

underlying system ensures that each unit of work, each transaction, fully completes<br />

without interference from other processes. If not, it rolls back the transaction and<br />

completely undoes whatever work the transaction had performed.<br />

Characteristics of transactions<br />

Typically, transactions refer to operations that access a shared resource like a<br />

database. All access to a database is performed in the context of a transaction. All<br />

transactions share the following characteristics:<br />

■<br />

■<br />

■<br />

Atomicity<br />

Consistency<br />

Isolation<br />

■<br />

Durability<br />

These characteristics are denoted by the acronym ACID.<br />

A transaction often consists of more than a single operation. Atomicity requires that<br />

either all or none of the operations of a transaction are performed for the transaction to<br />

be considered complete. If any of a transaction's operations cannot be performed, then<br />

none of them can be performed.<br />

Chapter 19: Transaction management 167

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!