openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <>
Subject Re: EntityNotFoundException caused by EntityManager.refresh()
Date Thu, 15 Apr 2010 21:35:17 GMT

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 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, 

View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message