posted 23 years ago
OK, back to what I said earlier. Because EJBs are independent objects in their own right, any relationship(s) between an EJB and a row (or rows) in a database is whatever you (and your EJB container) define.
It is possible to design multiple EJBs that reference the same table row, but in practical terms, about all that would gain you would be trouble, since the EJB container is expected to manage EJBs, not whatever persistent storage system you're using. BMPs are dangerous because the only DBMS consistency logic will be whatever you code yourself, but CMPs are perhaps even more treacherous, since there's nothing in the EJB specs to address this and they can therefore be expected to behave unpredicatably from the DBMS's point of view.
If you gain 2 references to an EJB and they both return the same Primary Key, they ARE the same EJB, regardless of what type of interface you're using and INDEPENDENT of what -- IF ANY -- DBMS or other data persistency mechanism is backing the EJB.
Experience keeps a dear School, but Fools will learn in no other.
---
Benjamin Franklin - Postal official and Weather observer