openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pinaki Poddar <ppod...@apache.org>
Subject Re: ArgumentException in refresh()
Date Wed, 01 Apr 2009 03:12:18 GMT

> (our application is multithreaded)
thought so. Is
  <property name="openjpa.Multithreaded" value="true"> set?


Hey,
In our program we have the next lines:
if (!em.find(entity.id , entity.getClass()))
    return;

entity.refresh();

sometimes we get ArgumentException in the refresh line. 
The cause is that the entity is not managed by this context.
When we use em.contains(entity), the return value is false, but in other cases this is not
enough and an EntityNotFoundException is thorwn.

Is it needed to check both - contains and find?

(our application is multithreaded)

thanks,
Michael and Udi




-----
Pinaki Poddar                      http://ppoddar.blogspot.com/
                                      
http://www.linkedin.com/in/pinakipoddar
OpenJPA PMC Member/Committer
JPA Expert Group Member
-- 
View this message in context: http://n2.nabble.com/ArgumentException-in-refresh%28%29-tp2552644p2566881.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message