You are right. Unfortunately there is no portable way to identify the entity that caused the problem. OptimisticLockException has such option, but it's not guaranteed to be available at all times.
I've seen requests to the next version of the spec to provide a feature that allows to extract the SQLException in a generic way from a PersistenceException, may be you should send your suggestions to the JPA 2.0 expert group as well.
Regards,
-marina
[Message sent by forum member 'mvatkina' (mvatkina)]
http://forums.java.net/jive/thread.jspa?messageID=234471