I had the impression that:
-NoSuchEntityException would be thrown when a BMP or CMP tries to access an entity, which has been already removed from underlying persistent store.
- and NoSuchObjectException would be thrown when the client calls a method, but the EJBObject has been removed from server.
But, the section 18.3.4 of the spec, titled "javax.ejb.NoSuchEntityException", says following, which is confusing me:
.....
To give the client a better indication of the cause of the error, the Container should throw the java.rmi.NoSuchObjectException (which is a subclass of java.rmi.RemoteException) to a remote client, or the javax.ejb.NoSuchObjectLocalException to a local client.
Does this mean that when the container detects that the entity has been removed, it will destroy the EJBObject???
Can someone please help me clarify this?