I am trying to implement the optimistic locking for BMPs using timestamp approach and using the where clause in the UPDATE statement. I then check for the updateCount returned by the executeQuery (). If the count is not 1, I would like to throw an exception to indicate that the record is already updated by some other user. I want to display appropriate message to the user.

My question is how can I throw an application exception from ejbStore? If I throw EJBException, the client always receives RemoteException.

Can anyone guide me here?

Thanks in advance,