Sometimes, you can live with a little mystery. Other times, you have to be
sure. You wouldn't want to use an ATM that sometimes removed too much money
from your account if it loses a connection, so why would your users want to be
double-billed if something unexpected happened in your application? Jeff
Mesnil explains how transactions can improve the consistency of your data in Adding
Transactions to Servlets with JOTM. (They're not just for servlets,
though!)

To subscribe to the ONJava.com newsletter (or any O'Reilly Network newsletters), visit https://epoch.oreilly.com/account/default.orm and select the newsletters you wish to receive in your user profile (you'll need to log in with your existing O'Reilly Network account -- if you don't yet have an account, you'll need to create one).