[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4959) Concurrent HQL parsing blocks on ReflectHelper.classForName()

Pepelner Johann (JIRA) noreply at atlassian.com
Thu Nov 25 10:55:13 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=39213#action_39213 ] 

Pepelner Johann commented on HHH-4959:
--------------------------------------

I have captured an Issue 'HHH-5753' which addresses the loading of Entities from the ReflectionHelper which have no class assigned and always throws ClassNotFoundException.

> Concurrent HQL parsing blocks on ReflectHelper.classForName()
> -------------------------------------------------------------
>
>                 Key: HHH-4959
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4959
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: query-hql
>    Affects Versions: 3.3.2
>         Environment: DB2
>            Reporter: Jarl Totland
>            Priority: Minor
>         Attachments: ReflectHelper.java
>
>
> For particularly HQL-heavy applications, concurrency is lost as ReflectHelper.classForName() blithely runs loadClass() for tokens again and again, many of which are not even classes. As loadClass() is synchronized it end up blocking while it generates stacktraces for its exceptions. This goes for both classic and AST parsers.
> Because of this blocking our regression tests took over 20 minutes, regardless of number of threads.
> Implementing a simple cache from String to Class in ReflectHelper.classForName() reduced this to 3 minutes for eight threads on a dual-core cpu; the bottleneck is now the database as it should be, not lock contention.
> The issue was reported earlier in HHH-1810, but dismissed as related to the classic parser only.
> We might use HQL in inappropriate ways, but still wouldn't hurt for Hibernate to support this.
> Attached is our modified ReflectHelper; modified code is in the classForName()-methods, classForNameInternal(), and the static HashMap<String, Object> classes.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list