From: Sergey V. (JIRA) <no...@at...> - 2006-06-30 09:01:29
|
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-1490?page=all ] Sergey Vladimirov updated HHH-1490: ----------------------------------- Attachment: patch.txt Patch to cache classes > QueryCache should not call EntityType.getReturnedClass() or do it fast > ---------------------------------------------------------------------- > > Key: HHH-1490 > URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1490 > Project: Hibernate3 > Type: Improvement > Components: core > Versions: 3.1.2 > Environment: Hibernate 3.1.2, MySQL 5.0.18-nt > Reporter: Sergey Vladimirov > Priority: Minor > Attachments: patch.txt > > > org.hibernate.cache.QueryKey should not call EntityType.getReturnedClass() or do it fast, because EntityType.getReturnedClass() works with ClassLoader - i is very expensive operation: > Stack trace: > java.lang.ClassLoader.findLoadedClass0(Native Method) > java.lang.ClassLoader.findLoadedClass(ClassLoader.java:922) > java.lang.ClassLoader.loadClass(ClassLoader.java:295) > - locked sun.misc.Launcher$AppClassLoader@93dee9 > sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:276) > - locked sun.misc.Launcher$AppClassLoader@93dee9 > java.lang.ClassLoader.loadClass(ClassLoader.java:251) > org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:95) > org.hibernate.type.EntityType.getReturnedClass(EntityType.java:91) > org.hibernate.cache.QueryKey.equals(QueryKey.java:59) > org.apache.commons.collections.map.AbstractReferenceMap.isEqualKey(AbstractReferenceMap.java:433) > org.apache.commons.collections.map.AbstractHashedMap.getEntry(AbstractHashedMap.java:434) > org.apache.commons.collections.map.AbstractReferenceMap.getEntry(AbstractReferenceMap.java:404) > org.apache.commons.collections.map.AbstractReferenceMap.get(AbstractReferenceMap.java:229) > ru.arptek.common.collections.SynchronizedMap.get(SynchronizedMap.java:94) > Operations with ClassLoaders is not falst enought for equals() operations. May be one should add some kind of caching (in EntityType, for example) or compare EntityType by class names, not by Class objects. -- 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 |