Hello Everyone,
We need your help as we are facing a serious production issue. Entire Application is hung because CPU usage becomes high due to lot of hung threads on WAS server.
Please see the code below which seems to create hung threads, we are using hibernate version 2.0 jars.
Can anyone help us in this?
import net.sf.hibernate.*;
public CarrierProfile getCarrier(String carrierCD) throws Exception { CarrierProfile carrier= null;
Query query=getSession().createQuery(" from CarrierProfile carrier where carrier.delDate is null and carrier.carrierCD=?");
query.setString(0,carrierCD); ArrayList<CarrierProfile> carriers;
carriers=(ArrayList<CarrierProfile>) query.list(); if(carriers!=null && carriers.size()>0){ carrier=carriers.get(0); }
return carrier; }
Please see log below from our production system:
30/01/14 11:06:43:122 EST] 00000017 ThreadMonitor W WSVR0605W: Thread "WebContainer : 4" (0000001e) has been active for 903762 milliseconds and may be hung. There is/are 13 thread(s) in total in the server that may be hung. at sun.reflect.Reflection.getClassAccessFlags(Native Method) at sun.reflect.Reflection.quickCheckMemberAccess(Reflection.java:63) at java.lang.reflect.Method.invoke(Method.java:579) at net.sf.hibernate.property.BasicPropertyAccessor$BasicGetter.get(BasicPropertyAccessor.java:96) at net.sf.hibernate.persister.AbstractEntityPersister.getPropertyValues(AbstractEntityPersister.java:253) at net.sf.hibernate.impl.SessionImpl.flushEntity(SessionImpl.java:2502) at net.sf.hibernate.impl.SessionImpl.flushEntities(SessionImpl.java:2486) at net.sf.hibernate.impl.SessionImpl.flushEverything(SessionImpl.java:2281) at net.sf.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:1815) at net.sf.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:1578) at net.sf.hibernate.impl.SessionImpl.find(SessionImpl.java:1543) at net.sf.hibernate.impl.QueryImpl.list(QueryImpl.java:49) at au.com.woolworths.replenishment.dao.hibernate.scheduler.SchedulerBookingDAOImpl.getCarrier(SchedulerBookingDAOImpl.java:686)
Thanks a lot in advance for your time in going through this.
Regards, Abhishek
|