Day 8. Transactions and Persistence

You have spent the last three days covering EJBs in detail. In particular, you saw yesterday how to specify, implement, configure and deploy container-managed persistence (CMP) Entity beans. Along with BMP Entity beans (Day 6, “Entity EJBs”) and Session beans (Day 5, “Session EJBs”), you now have a good appreciation of the EJB technology.

EJBs have been called transactional middle-tier components. Until now, you haven't had to worry too much about transactions in an EJB context because you have been using container-managed transaction demarcation. However, for those cases where you require explicit control, EJB provides two solutions. You can write beans that manage their own transactions—bean managed transaction demarcation—or you can extend the lifecycle of Session beans to give them visibility of the transaction demarcations. You will be learning about both solutions today.

You spent Day 6 and Day 7, “Container-Managed Persistence, Container-Managed Relationships, and EJB Query Language,” comparing the two different persistence approaches offered by EJBs in the guise of BMP and CMP Entity beans. The BMP Entity beans were implemented using JDBC, but that is only one of a number of technologies offered by J2EE and Java in general. Today, you will see

  • How to manage transactions explicitly in EJBs

  • How transactions are managed “behind the scenes” in an EJB environment

  • Persistence technologies other than JDBC—specifically, SQLj and JDO

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

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