Hi Heiko, Do you have CascadeType.REFRESH or CascadeType.ALL specified for Addresses? If a related entity no longer exists in the database then an EntityNotFoundException needs to be thrown (spec p. 75).
It gets a little nebulous when you're talking about toMany relationships. EntityManager.refresh() indicates that the contents of the entity are updated from the database, but it looks like OpenJPA is refreshing the entity, and any related entities based on the references in memory. I'd say this is a bug, if you could open a https://issues.apache.org/jira/browse/OPENJPA JIRA issue we'll start working on the problem. Or if you don't have / don't want a JIRA account I can open it on your behalf. Your workaround seems safe for the time being. Thanks for reporting this, -mike -- View this message in context: http://n2.nabble.com/EntityNotFoundException-caused-by-EntityManager-refresh-tp4901557p4910126.html Sent from the OpenJPA Users mailing list archive at Nabble.com.
