openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jody Grassel (JIRA)" <>
Subject [jira] [Commented] (OPENJPA-1993) Deadlock Potential with ORM XML Processing
Date Wed, 04 May 2011 22:38:03 GMT


Jody Grassel commented on OPENJPA-1993:

Checked in the fix for this issue.  To preserve original behavior, the ContextClassLoader
override will only take place if the following OpenJPA Compatibility option is set:


> Deadlock Potential with ORM XML Processing
> ------------------------------------------
>                 Key: OPENJPA-1993
>                 URL:
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: kernel
>    Affects Versions: 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.2.0, 1.2.1, 1.2.2, 2.0.0, 2.0.1,
>            Reporter: Jody Grassel
>            Assignee: Jody Grassel
> There exists the potential for deadlock with the ORM XML processing function.  In an
> with multiple threads (such as an application server), operations (such as creating a
> EntityManagerFactory or transformation Classloader activity) can lead to a point where
> a Xerces SAX Parser (acquired by XMLFactory) is constituted and executed.  Xerces calls

> Thread.currentThread().getContextClassloader() during its execution to construct the
> SAXParser (via ObjectFactory.createObject()).  This means that within the call to Xerces,
> a ClassLoader lock will be attempted on the Thread's ContextClassLoader.  If there is
> a lock with a ClassLoader higher in the heirarchy, and another thread with a lock on
> same ContextClassLoader that is waiting to acquire a lock on a higher level ClassLoader,
> a deadlock will occur.
> A solution to this problem is to temporally set the Thread's ContextClassLoader at the
> point where XML APIs are invoked (such as in XMLFactory, XMLMetaDataParser) to the
> ClassLoader that loaded the OpenJPA implementation classes.  This will prevent Xerces
> starting with a lower level classloader and avoid this deadlock potential.

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message