Howdy,
Yep, in the spec (6.3.2) it states that calling remove(Object pk) on EITHER the remote or local home of a session bean will result in a RemoveException, but that's because there IS such a thing as a RemoveException (an application exception).
With the getPrimaryKey() method, there is no special application exception for that, so instead the normal EJB exception rules apply: remote clients get a RemoteException, and local clients get the EJBException.
So think of it as something like this:
-The RemoveException exists to tell you that something went wrong with the remove. Since remove is an important part of the behavior of your application, and there's no return value for the method, you need a way to know that the remove didn't happen. Calling remove with a primary key, for a session bean, definitely means that the remove didn't happen, so you get the RemoveException. They could have chosen to instead throw the client an EJBException or RemoteException, and that would have made sense as well... since calling remove(Object pk) on a session bean is an obvious problem!! But since there IS a RemoveException, the EJB spec designers decided to use the more specific application exception that says, "Something bad happened in remove, and the object was not necessarily removed!" (in this case, definitely NOT removed).
- But there is NOT a specific application exception related to getting a primary key, so you simply get the normal EJB exception process if you call getPrimaryKey() on a session bean's component interface... local clients get EJBException and remote clients get RemoteException.
So, to me it could have made sense either way, but since there IS a specific application exception, RemoveException, thrown by the remove method, that's what the client gets.
Think of the RemoveException as being thrown for two different reasons:
1) Something genuinely DID go wrong with the remove (including an entity bean that is refusing to allow client-directed removal).
2) The client is stupid, and called remove(pk) on a session bean

In this case, RemoveException doesn't mean, "something went wrong" but rather "the client is an idiot". But since they don't have a ClientIdiotException (which I personally would probably get on a regular basis), you get the RemoveException instead
cheers,
Kathy