Chapter 5 of the EJB book
walked you through all of the details for deploying, creating, and
interacting with the
interface. This chapter uses the same Cabin entity bean introduced in
Chapter 4 to illustrate the
concepts and APIs discussed in Chapter
5. You will see examples of:
merge( ), flush( ), and
refresh( ) operations in
An explanation of
The differences between a transaction-only and an extended persistence context
Using Java Persistence in a standalone Java application
This exercise has four different clients to build and run against the JBoss application server:
This client demonstrates what happens when you use the
operation. It interacts with the TravelAgent EJB.
This client demonstrates the difference between a transaction-only and an extended persistence context. The TransactionPersistenceContext EJB injects and uses a transaction-scoped entity manager. The ExtendedPersistenceContext EJB injects and uses an extended entity manager.
This client demonstrates how
FlushModeType affects your
application—specifically, when updates are synchronized with the
These clients must be executed in order; Client_1 creates a Cabin entity that is used by ...