Hello Mike,

Michael Dick wrote:
> 
> Hi Heiko,
> 
> Could the entity, or any of the entities it's related to, have been
> deleted from the database? 
> 
> You're using a fairly old snapshot version of 1.3.0 and there have been a
> lot of changes. Can you try with an updated snapshot? You can grab the
> latest snapshot from
> http://people.apache.org/repo/m2-snapshot-repository/org/apache/openjpa/apache-openjpa/1.3.0-SNAPSHOT/.
>  
> 
> Regards
> -mike
> 

I've now tried the newest version of OpenJPA 1.3, but still the error
occurs. If an address is deleted and a refresh is done to the person object
itself, thus the situation is as follows:

find(id) leads to

Person (entity)
    List of Addresses
         Address A (entity)
         Address B (entity)
         Address C (entity)

Now, outside of the scope of the application lets assume the table entry of
'Address B' is deleted from the database.

A second find(id) should (from my perspective) lead to 

Person (entity)
    List of Addresses
         Address A (entity)
         Address C (entity)

but throws the EntityNotFoundException at 'refresh()' for the Entity of
Address B.

My current solution to this is, that in case the exception occurs, I simply
repeat what I did, thus call find() and refresh() once again. This works
now, but I'm really unsure if its a good solution this way.

Any ideas?

Best regards,

Heiko
-- 
View this message in context: 
http://n2.nabble.com/EntityNotFoundException-caused-by-EntityManager-refresh-tp4901557p4906091.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to