On Aug 3, 2009, at 14:58 , Claudio Di Vita wrote:


Hi to all,

I'm having some troubles using OpenJPA in a multithreaded environment.

Sometimes (because it happens randomly) some entities aren't persisted, but OpenJPA doesn't throw any exception. Please note that I persist a set of
entities (instances of the same class) that don't share any kind of
information.

I haven't set the property openjpa.Multithreaded to true because I use a different EntityManager for each thread (I get it through a ThreadLocal).
Obviously If I set this property everything seems to work right.

So I want to understand why I have to set this property: I'm not doing
something right or property openjpa.Multithreaded is mandatory for
multithreaded environments (even using different EntityManagers) ??

Did you compared using == what you think is different instance of EntityManager ? Reading your message tend to prove that EntityManager is shared and when you think you got a new one it is not a new one.

Thank you for the help,

Claudio

-----
Not everything that can be counted counts, and not everything that counts can
be counted - Albert Einstein
--
View this message in context: 
http://n2.nabble.com/Persist-issue-in-multithreaded-environment-tp3377510p3377510.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Reply via email to