[jira] [Commented] (OPENJPA-2699) Occasional deadlock initializing the XML Parser

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Commented] (OPENJPA-2699) Occasional deadlock initializing the XML Parser

JIRA jira@apache.org

    [ https://issues.apache.org/jira/browse/OPENJPA-2699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16050828#comment-16050828 ]

Jody Grassel commented on OPENJPA-2699:
---------------------------------------

The original problem was that a deadlock could occur in an Enterprise environment (WebSphere in particular) when two concurrent threads are loading a class which triggers a transformer, where there are two classloaders with one a child of the other.  The deadlock would occur when OpenJPA initialized the saxparser, which searches for parser impls using the thread context classloader, which happened to be the leaf classloader in that scenario.  The solution was to temporally override the thread context classloader when initializing the xml parser to the classloader used to load openjpa, avoiding that problem.

When I first introduced the fix, I shipped it as disabled (think in 2.0.x or 2.1.x) by default (needing to be enabled manually), but shipped it as enabled in trunk and in 2.2.x.  Because the configuration wasn't directly accessible in the place where the temp override needed to occur, there was a bit of a convoluted means to set that variable to match the configuration.  I suspect that there is an alternate path that reaches the xml parser initialization point that misses pulling that value from configuration.  

But, in 2.2.x and trunk, it should have been set to true (the default) anyways, and I must have missed setting that value when I delivered the update to enable it by default in 2.2.x.

So I am fine with the change, it's the one I was recommending to resolve the problem anyways.

> Occasional deadlock initializing the XML Parser
> -----------------------------------------------
>
>                 Key: OPENJPA-2699
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2699
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: jpa
>    Affects Versions: 2.2.2
>            Reporter: Will Dazey
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 2.2.2
>
>         Attachments: OPENJPA-2699-2.2.x.patch
>
>
> This change was missed during OPENJPA-1993



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)