concept application transaction in category seam

appears as: n application transaction, pplication transactions, The application trsaction, An application trsaction, Application trsactions
Seam in Action

This is an excerpt from Manning's book Seam in Action.

The @Begin annotation is outlined in table 7.3. The pageflow attribute is used to initiate a stateful page flow and is covered in section 7.6. The flushMode attribute is used to switch the flush mode of the persistence context when the conversation begins and can be used to initiate an application transaction as covered in chapter 9.

I then unveiled Seam’s transaction support. You saw that global transactions extend the guarantees that transactions provide across the whole request, that Seam’s transaction abstraction layer makes the transaction APIs far more accessible, and that application transactions are the key to ensuring data consistency in a stateful application—enhanced by Hibernate’s MANUAL flush mode extension.

The application transaction (also called an atomic conversation, optimistic transaction, or long-running application transaction) is the pinnacle of Seam’s Java persistence support. It requires coordination from several different aspects of Seam, but it is without a doubt the key to ensuring data consistency in a web-based application.

Listing 9.2. A component that supports an application transaction

What’s important is that you aren’t forced to sidestep transactional methods to implement an application transaction. The MANUAL flush mode instructs the persistence context not to take action until it hears your command, ensuring that the conversation isn’t broken by a premature flush. In the interim, you’re free to use transactions to get proper read isolation or for any other purpose.

Application transactions demonstrate the resourcefulness of the persistence context when treated as a first-class citizen of a use case and not relegated to the handyman of a transaction. For more in-depth coverage of application transactions, consult Chapter 11 of Java Persistence with Hibernate (Manning, 2007).