openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Sutter <kwsut...@gmail.com>
Subject Re: Supposed concurrent access issue to PCPath instance
Date Tue, 08 Oct 2013 20:45:41 GMT
Something's missing from your post.  There is no error message or query
posted...

As far as mulit-user access...  EntityManagers are not meant to be shared
by multiple threads.  That's defined by the spec.  So, under normal
circumstances, not protecting the data structures down these paths is fine.

As a quick test, you can set the property openjpa.Multithreaded to true
[1].  If you use this property and you no longer experience this
concurrency issue, then this shows that you have a problem with your
application.  You are either accidentally or on purpose sharing an instance
of an EM.  You should not be doing that.  Find out how to modify your
application to avoid the use of this property and then remove it.

Good luck,
Kevin


[1]
http://ci.apache.org/projects/openjpa/trunk/docbook/manual.html#openjpa.Multithreaded


On Tue, Oct 8, 2013 at 3:18 PM, mrgiba <mrgiba@ig.com.br> wrote:

> Hi,
>
> Has anyone ever experienced any issue with concurrent access to PCPath
> resources ?
>
> I got the error below once:
>
>
>
> The error happened in a multi user scenario when processing the following
> query:
>
>
>
> Looking at the OpenJPA 2.2.1 source code, I noticed that not all methods
> that read/write the _actions collection from CandidatePath class (super
> class of PCPath) have a synchronized block or any other concurrency
> control.
> If the same PCPath instance can really be accessed by more than one thread,
> then there are really chances to trouble
>
>
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Supposed-concurrent-access-issue-to-PCPath-instance-tp7585102.html
> Sent from the OpenJPA Developers mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message