Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] EntityManager and thread safety

Hi,

I have some questions about thread safety and EclipseLink's EntityManager.

I understand that the spec says it's not safe to access an entity manager concurrently from multiple threads.

But, supposing that I use synchronized blocks or java.util.concurrent locks as a mutual exclusion mechanism to guarantee that no two threads will concurrently access the same entity manager or any of the entities it manages: in this case, is it safe to access the entity manager and the entities it manages from different threads?

I understand that the behavior may be different in EclipseLink vs. other JPA implementations. I'm only asking about EclipseLink.

Thanks a lot,
Ben


Back to the top