-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: ClassLoader.loadClass Blocking
PostPosted: Tue Mar 05, 2013 4:52 pm 
Newbie

Joined: Tue May 29, 2012 11:46 pm
Posts: 4
Hibernate 3.6.10.Final
Java 1.6 Update 39
App Server :- Weblogic 10.3.6

Under heavy load for our application, thread dumps taken and below blocking is coming for so many threads

"[ACTIVE] ExecuteThread: '54' for queue: 'weblogic.kernel.Default (self-tuning)'" daemon prio=3 tid=0x000000000593d800 nid=0x61 waiting for monitor entry [0
xfffffd7ff3146000]
java.lang.Thread.State: BLOCKED (on object monitor)
at java.lang.ClassLoader.loadClass(ClassLoader.java:291)
- waiting to lock <0xfffffd7f1037f4f8> (a weblogic.utils.classloaders.ChangeAwareClassLoader)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
at weblogic.utils.classloaders.ChangeAwareClassLoader.loadClass(ChangeAwareClassLoader.java:43)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:187)
at org.hibernate.util.ReflectHelper.getConstantValue(ReflectHelper.java:266)
at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.handleDotStructure(QueryTranslatorImpl.java:606)
at org.hibernate.hql.ast.QueryTranslatorImpl$JavaConstantConverter.visit(QueryTranslatorImpl.java:601)
at org.hibernate.hql.ast.util.NodeTraverser.visitDepthFirst(NodeTraverser.java:78)
at org.hibernate.hql.ast.util.NodeTraverser.traverseDepthFirst(NodeTraverser.java:66)
at org.hibernate.hql.ast.QueryTranslatorImpl.parse(QueryTranslatorImpl.java:282)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:184)
- locked <0xfffffd7fc89ee2f8> (a org.hibernate.hql.ast.QueryTranslatorImpl)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:138)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.<init>(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:124)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1260)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
at com.whg.xms.aricache.data.hibernate.ARIBaseDAO$2.doInHibernate(ARIBaseDAO.java:284)
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:406)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:339)
at com.xxx.yyy.zzz.data.hibernate.XXXDAO.executeQuery(ARIBaseDAO.java:259)
at com.xxx.yyy.zzz.data.hibernate.ABCDAOImpl.findAllTTTId(ABCDAOImpl.java:559)
at sun.reflect.GeneratedMethodAccessor166.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196)
at sun.proxy.$Proxy87.ZZZByRoomTypeAndRatePlanId(Unknown Source)
at com.xxx.yyy.zzz.service.YYYProcessorImpl.loadUUUIntoCacheLst(RestrictionsProcessorImpl.java:668)
at com.xxx.yyy.zzz.service.ABCImpl.loadUUUCacheLst(RestrictionsServiceImpl.java:588)
at com.xxx.yyy.zzz.handler.YlHandlerWork.run(RealTimeAvailHandlerWork.java:43)
at weblogic.work.j2ee.J2EEWorkManager$WorkWithListener.run(J2EEWorkManager.java:184)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)

Please advise, how to resolve the ClassLoader.loadClass blocking?. Any suggestions welcome.


Top
 Profile  
 
 Post subject: Re: ClassLoader.loadClass Blocking
PostPosted: Sun Mar 10, 2013 1:11 pm 
Newbie

Joined: Tue May 29, 2012 11:46 pm
Posts: 4
This issue was due to application using dynamic queries. Due to this, huge no of queryPlan cache getting generated. Defualt soft ref cache size is 2024. We are fixing the dynamic queries issue in application and instead use named variables so that queryPlan cache does not create large. This should provide huge amount of performance improvement for application and classloader.load class blocking should not happen.


Top
 Profile  
 
 Post subject: Re: ClassLoader.loadClass Blocking
PostPosted: Mon Mar 11, 2013 1:17 pm 
Newbie

Joined: Tue May 29, 2012 11:46 pm
Posts: 4
We have lots of places in application where we are setting list of strings for "in" operator as part of HQL/native sql.



prt.rate_plan_id in (:ratePlanArray)

For ratePlanArray named variable, list of string is set setParameterList().

Hibernate is setting query string for Query Plan Cache key as:-

prt.rate_plan_id in (:ratePlanId0_, :ratePlanId1_, :ratePlanId2_, :ratePlanId3_, :ratePlanId4_, :ratePlanId5_)

This will generate huge no of distinct queries for query Plan cache. Is there way, Hibernate does put only names variable in the queryString for ParameterList.


prt.rate_plan_id in (:ratePlanArray)


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.