InfoQ

InfoQ

Minibook

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Java Transaction Design Strategies

Posted by Mark Richards on May 14, 2006

Sections
Architecture & Design,
Development,
Enterprise Architecture
Topics
Java ,
Transactions Processing
Tags
Spring ,
EJB ,
Design Patterns ,
JDBC

Java Transactions Book Free Downloadable PDF

Understanding how transaction management works in Java and developing an effective transaction design strategy can help to avoid data integrity problems in your applications and databases and ease the pain of inevitable system failures.

This book is about how to design an effective transaction management strategy using the transaction models provided by Java-based frameworks such as EJB and Spring. Techniques, best practices, and pitfalls with each transaction model will be described. In addition, transaction design patterns will bring all these concepts and techniques together and describe how to use these models to effectively manage transactions within your EJB or Spring-based Java applications.  

Free download, buy the print version for $22.95

If you enjoyed reading the free downloadable version, please support the author as well as future InfoQ books by purchasing the print copy for only $22.95 or Login to download this book FREE (PDF)

Table of Contents

Introduction

  • Transaction Models
  • Where’s the ACID, Man?
  • JTA and JTS
  • UserTransaction Interface
  • TransactionManager Interface
  • EJBContext Interface
  • Status Interface

The Local Transaction Model

  • Auto Commit and Connection Management
  • Local Transaction Considerations and Limitations

The Programmatic TransactionModel

  • Obtaining a Reference to the
  • JTA UserTransaction
  • Programmatic Transaction Coding Traps
  • The Transaction Context Problem
  • Programmatic Transaction Scenarios

The Declarative Transaction Model

  • Transaction Attributes
  • Specifying Transaction Attributes
  • Exception Handling and thesetRollback() Method
  • EJB 3.0 Considerations
  • setRollbackOnly() Alternative
  • Using Required vs. Mandatory
  • Transaction Attributes
  • The Reality of Transaction Isolation Levels

XA Transaction Processing

  • The XA Interface Explained
  • When Should You Use XA?
  • Two-Phase Commit
  • Heuristic Exception Processing
  • Enabling Queues and Topics for XA
  • Enabling Databases for XA

Client Owner Transaction  Design Pattern
Domain Service Owner Transaction Design Pattern
Server Delegate Owner Transaction Design Pattern

About the author

Mark Richards is Certified Senior IT Architect at IBM, where he is involved in the architecture and design of large-scale Service Oriented Architectures in J2EE and other technologies, primarily in the financial services industry. He has been involved in the software industry as a developer, designer, and architect since 1984, speaks frequently at the No Fluff Just Stuff Symposiums and holds a Masters Degree in Computer Science from Boston University, and holds a number of Sun, IBM, and BEA Java and architect certifications.  Feel free to email Mark with any comments or questions about the book.

About the InfoQ Enterprise Software Development Series

Books on InfoQ are intentionally short and attempt to address important, timely issues in as concise a way as possible. The book's writing is intended for the Senior Architect/team lead audience.  Ever thought of writing a book? Our series is a great way to start. InfoQ offers abnormally high royalties and also contract writing opportunities. Email books AT c4media.com for opportunities.

Educational Content

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.

Polyglot Persistence for Java Developers - Moving Out of the Relational Comfort Zone

Chris Richardson shows how he ported a relational database to three NoSQL data stores: Redis, Cassandra and MongoDB.

The Golden Circle – Why How What

Jean Tabaka challenges the audience to reflect on what Agile practices they are employing, how they are using them, ending with the questions “Why have their organization chosen to go Agile?

The Web Platform as a Limitless Pool of Innovation, with Andreas Gal

Andreas talks about the benefits of the Open Web and how it compares to proprietary stacks. He also talks about various projects that push the envelope like Boot to Gecko, Broadway and pdf.js.

Hadoop and NoSQLin a Big Data Environment

Ron Bodkin discusses early adoption of Hadoop, NoSQL and describes MapReduce and related libraries and Frameworks. Other topics include Hive, Pig, multi tenancy, and security in a big data environment

Spring and Platform Interoperability

Stephen Bohlen explains how Spring helps with interoperability between Java and .NET, demoing it with the help of a sample application.

How to Stop Writing Next Year's Unsustainable Piece of Code

Guilherme Silveira mentions some of the turning points in project development that may affect the quality of the code offering advice on avoiding writing crappy code.