Q&A

Q1:In which tier should I implement the referential integrity constraints?
A1: It's generally best to implement referential integrity constraints logic in the EIS tier rather than the EJB tier. Implementing the constraints in the EIS tier means that they can be used by non-J2EE applications and offer greater performance and reliability. Implementing such constraints in the EJB tier duplicates logic and makes maintenance difficult. On the other hand, EIS tier constraints such as database procedural triggers are not portable across database vendors.

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.