openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Dick <michael.d.d...@gmail.com>
Subject Re: Stuck threads at Schema.getTable.
Date Mon, 28 Mar 2011 17:00:22 GMT
Hi Ravi,

The link didn't work for me, is this a bug in the TreeMap implementation?

Multithreaded reads of a TreeMap should be fine. If a thread is adding or
deleting a node then we'll need to synchronize - is that what's happening in
your case?

I've cross posted to dev - might get a better audience there.

-mike

On Sun, Mar 27, 2011 at 10:06 PM, Ravi P Palacherla <
ravi.palacherla@oracle.com> wrote:

> Hi ,
>
> I see following stuck threads in openJPA code :
>
>  java.lang.Thread.State: RUNNABLE
>   at java.util.TreeMap.getEntry(TreeMap.java:328)
>   at java.util.TreeMap.get(TreeMap.java:255)
>   at org.apache.openjpa.jdbc.schema.Schema.getTable(Schema.java:115)
>
> I think the root cause of the issue is because of unsynchronized TreeMap.
>
> There is a sun issue that explains the same about a hashMap and I think
> this
> is also because of the same issue explained in:
> http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6423457
>
> So, the fix is to synchronize the TreeMap but I do not have a replicable
> test case.
>
> I created a simple testcase that will create around 100000 treeMap entries
> and then around 50 threads trying to access this treeMap but unable to
> replicate the issue.
>
> Please suggest what you think should be done.
> Can I just submit the code fix ( synchronizing the treemap) and the test
> case ( even though unable to replicate ) ?
>
> Regards,
> Ravi.
>
> --
> View this message in context:
> http://openjpa.208410.n2.nabble.com/Stuck-threads-at-Schema-getTable-tp6213602p6213602.html
> Sent from the OpenJPA Users mailing list archive at Nabble.com.
>

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