Java Reference
In-Depth Information
which consists of a number of tiers which can be used together, the APIs that support these patterns can be used at
a number of points, or even multiple points, within a J2EE system.
Transaction (see page 265): Frequently, the connectors link a J2EE application to some other system which
supports transaction management. The Java Transaction API (JTA) provides support for distributed transaction
coordination—what is commonly called a two-phase commit. For technologies that support this API, they must be
general transactional services. This in turn means that they must support the Commit/Rollback pattern.
Session (see page 220): J2EE also provides support for the Session pattern. The incentive for using this pattern
within a J2EE model is clear: mid-term data persistence is usually important in an enterprise application. Most
non-trivial business operations require some form of intermediate storage, to maintain state between operational
phases or to ensure that the data will not be lost or corrupted while in flux.
In a typical enterprise application, short-term data is stored on the clients and long-term data is stored in a
database or other EIS resource. Somewhere between these two extremes is data that is related to business process;
that is, to work that is being done and requires several actions to complete. Mid-term persistence is what the
Session pattern is all about: the storage of information that is in flux due to a client's interaction with the system.
J2EE is an n-tier system, so there are a few options for where to store Session data:
On the client tier - J2EE Web clients can use cookies to store session-based information.
On the web tier - The servlet API defines an HttpSession interface to address client storage requirements.
On the EJB tier - Stateful session beans serve this purpose, as defined in the EJB specification.
Search WWH ::




Custom Search