InfoQ

Minibook

Java Transaction Design Strategies

Posted by Mark Richards on May 14, 2006

Community
Java
Topics
Transactions Processing
Tags
JDBC ,
Spring ,
EJB ,
Design Patterns

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

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.