11 Transactions and Persistence

Transactions are an essential feature for database-driven web applications. In each conversation, we typically need to update multiple database tables. If an error occurs in the database operation (e.g., a database server crashes), the application needs to inform the user, and all the updates this conversation has written into the database must be rolled back to avoid partially updated (i.e., corrupted) records. In other words, all database updates in a conversation must happen inside an atomic operation. Transactions enable you to do exactly that.

In a Seam application, we typically assemble and modify database entity objects throughout a conversation. At the end of the conversation, we commit ...

Get Seam Framework: Experience the Evolution of Java™ EE, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.