I almost missed this one! After all the, um, *discussions* about the beta exam, I didn't realize that someone raised an honest to goodness technical question. Yay
Anyway, the "NoSuchObjectException" is not guaranteed for the client, although the container is "encouraged" to throw that. When you throw a NoSuchEntityException from, say, your ejbLoad method (for a BMP bean, when you discover to your horror that someone deleted this entity from the underlying persistent store / database), the container IS required to handle it in the same way that it would handle any other EJBException.
A *nice* container will give the client a "NoSuchObjectException" to give them a better idea about what happened, but a container isn't required to do so. If the client tries to refind that same entity with a single-object finder, they'll get an ObjectNotFoundException.
And boy oh boy is it tough to remember the difference between NoSuchObjectException and ObjectNotFoundException. The only way I remember those is by keeping in mind the
word "Found" in ObjectNotFoundException -- which reminds you that this exception is a FinderException! That means the other one (NoSuchObjectException) must be the standard RMI Exception that a client gets when they have a stub to a remote object, and the remote object no longer exists. (Or, for the new 'local' version, that the local interface implementation being referenced no longer exists).
I'm so happy: a real question from the spec
Cheers,
Kathy
OK, let's have some more!