Exercises

A nice short exercise for you today.

The starting point for the exercise is a version of today's case study that uses BMTD for the AdvertiseJob bean. Now your job is to convert the Register bean (that deals with applicants) to use BMTD rather than CMTD. The code to work on is in the Day 8 exercise directory.

To avoid the complications of specifying EJB QL and generated SQL statements in the CMP version of the database, today's exercise reverts back to the original database; in fact, all remaining exercises based on the Agency case study will use the original database schema. The steps you should now perform are as follows:

1.
Make sure you restore the original database schema by going to the Day 2 directory and running the command

asant database

2.
Update the implementation of the various methods of RegisterBean class, basing it on AdvertiseJobBean. You will probably find it helpful to copy over the 3 helper methods (beginTransactionIfRequired(), statusAsString(), and completeTransactionIfRequired()).

3.
Use deploytool to update the RegisterBean to use BMP or, if using the asant build files, edit the Day08/exercise/dd/agency/session/ejb-jar.xml deployment descriptor, changing RegisterBean to use <transaction-type> of Bean. You can also remove the RegisterBean's container-transaction elements under the assembly-descriptor element because they will no longer be needed.

4.
Deploy and test this new version.

A solution is in the Day 8 agency directory.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.84.112