| The Samples
Gallery offers:
- Http session association (MasterMind)
A servlet provides the
user interface for a game called MasterMind. The game uses an HTTP session
to control the ActivitySession lifecycle, and talks to an enterprise bean,
which holds the state and provides the logic for the game. The aim of the
game is to guess the four-element code that is generated at the start. On
each guess, clues are given to the identity of the target code by how many
elements in the guess are present in the target and how many of these elements
are correctly placed.
- Container-managed ActivitySessions
This Sample consists of a
client, which begins and ends an ActivitySession, updating an entity bean.
The sample demonstrates client access to the UserActivitySession interface,
container-managed ActivitySessions and container resolution of resource-managed
local transactions. These transactions start within the enterprise beans that
have a local transaction containment (LTC) boundary of ActivitySession. The
client verifies that updates to bean instances are committed when the ActivitySession
is completed with the EndModeCheckpoint and rolled back when the EndModeReset
is used.
- Bean-managed ActivitySessions
This Sample consists of a client
that invokes a method on a stateless session bean. This session bean uses
bean-managed ActivitySessions, beginning and ending the ActivitySessions with
the UserActivitySession interface. During these ActivitySessions, a stateful
session bean is accessed. This stateful session bean, which uses container-managed
ActivitySessions, an LTC boundary of ActivitySession, and an LTC resolution
control of application, is called several times to update data in a database.
Sometimes the stateful session bean is instructed to complete the resource
manager local transactions (RMLTs), either to commit them or roll them back.
Sometimes the RMLTs are left incomplete. The stateless session bean then
completes the ActivitySession and reports back to the client whether the
results are consistent with the expected behavior.
|