9. Transactions

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 records (i.e., corrupted records). In other words, all database updates in the 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 all those entity objects ...

Get JBoss® Seam: Simplicity and Power Beyond Java™ EE now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.