background image

Removing the Generated Files

<< Running the Example Using Ant | Consumes Messages from a Remote Server >>
<< Running the Example Using Ant | Consumes Messages from a Remote Server >>

Removing the Generated Files

Employee ID: 26
Name: Jack Verdon
Equipment: Pager
Office number: 20
Waiting for 3 message(s)
New hire event processed:
Employee ID: 27
Name: Fred Tudor
Equipment: Pager
Office number: 51
Waiting for 2 message(s)
New hire event processed:
Employee ID: 28
Name: Fred Martin
Equipment: Desktop System
Office number: 141
Waiting for 1 message(s)
New hire event processed:
Employee ID: 29
Name: Mary Stuart
Equipment: Pager
Office number: 238
The output from the message-driven beans and the entity class appears in the server log,
wrapped in logging information.
For each employee, the application first creates the entity and then finds it. You may see
runtime errors in the server log, and transaction rollbacks may occur. The errors occur if both
of the message-driven beans discover at the same time that the entity does not yet exist, so they
both try to create it. The first attempt succeeds, but the second fails because the bean already
exists. After the rollback, the second message-driven bean tries again and succeeds in finding
the entity. Container-managed transactions allow the application to run correctly, in spite of
these errors, with no special programming.
Undeploy the application after you finish running the client:
ant undeploy
To remove the generated files, use the following command in the clientmdbentity,
clientmdbentity-app-client
, and clientmdbentity-ejb directories:
ant clean
A Java EE Application That Uses the JMS API with an Entity
The Java EE 5 Tutorial · September 2007
978