You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Romain Manni-Bucau (Jira)" <ji...@apache.org> on 2020/07/13 19:55:00 UTC

[jira] [Comment Edited] (OPENJPA-2817) OpenJPA enhancer needs improved reentrancy

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

Romain Manni-Bucau edited comment on OPENJPA-2817 at 7/13/20, 7:54 PM:
-----------------------------------------------------------------------

reopening for 3.1.3 which likely needs to drop _transforming as well - once we have the actual cause of this issue (current analyzis suspects an OpenLiberty classloading bug but we didn't get something concrete yet). But in any case the boolean of master but drop or be reworked.


was (Author: romain.manni-bucau):
reopening for 3.1.3 which likely needs to drop _transforming as well - once we have the actual cause of this issue (current analyzis suspects an OpenLiberty classloading bug but we didn't get something concrete yet).

> OpenJPA enhancer needs improved reentrancy
> ------------------------------------------
>
>                 Key: OPENJPA-2817
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2817
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: Enhance
>    Affects Versions: 2.2.2, 2.3.0, 2.4.3, 3.1.1
>            Reporter: Jody Grassel
>            Assignee: Jody Grassel
>            Priority: Major
>             Fix For: 2.2.3
>
>
> OpenJPA's class transformer was designed in a time when ClassLoader access was synchronized. Because it was assumed that if the ClassLoader caused another class to load while it was already enhancing a class, causing another triggering of the class transformer, it was assumed that that could only happen if OpenJPA was bundled as part of the application (loaded by the app classloader in an EE environment), and was safe to assume that this reentrant invocation would not be a request to enhance a persistent type, and thus return null (no enhancement needed).
> With Java 7+, ClassLoader locking has been changed ([https://docs.oracle.com/javase/7/docs/technotes/guides/lang/cl-mt.html]).  
> Now, because the same ClassLoader (and thus same transformer), can be invoked concurrently by different threads, this assumption was no longer valid.
> OpenJPA needs to be updated to be mindful of reentrancy on a thread scope, instead of just simply reacting to reentrancy whenever it happens.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)