[
https://hibernate.onjira.com/browse/HHH-6414?page=com.atlassian.jira.plug...
]
Guenther Demetz commented on HHH-6414:
--------------------------------------
Hi Mr. Ogier,
hi Mr Lukasiuk,
if your CPU's are on 100% and your threads are very often executing in
java.util.HashMap.put(HashMap.java:374)
org.hibernate.engine.StatefulPersistenceContext.addCollection(StatefulPersistenceContext.java:...)
then I see only 2 plausible conclusions:
1. You are loading very big collections.
To check this, please try to log the concerning Query statement, and find out how many
records are returned.
Needless to say that loading very large collections can become CPU instensive.
In such case the relations should be modelled in another way, or alternatively you can
use the EXTRA_LAZY feature.
So please tell us how big (concrete size of loaded collection) your collections are.
2. Your are running into a concurrency problem like reported in JGRP-525.
Such concurrency can only happen, if you are working with concurrent 2 threads on the
same hiberante session.
That's not allowed in Hiberante.
CPU spinning, stuck on getResultList()
--------------------------------------
Key: HHH-6414
URL:
https://hibernate.onjira.com/browse/HHH-6414
Project: Hibernate ORM
Issue Type: Bug
Components: core
Affects Versions: 3.3.1
Environment: Hibernate Annotations 3.4.0.GA, Hibernate 3.3.1.GA, Hibernate
Commons Annotations 3.1.0.GA, Hibernate EntityManager 3.4.0.GA, Seam 2.2.1.Final, JBoss
5.1.0.GA, Windows Server 2008 64bits, Microsoft SQL Server 10.00.4000, JDBC driver:
Microsoft SQL Server 2005 JDBC Driver, version: 1.2.2828.100
Reporter: Anthony Ogier
I've got a web application which is well tested (JMeter etc), and suddenly today, 2
of JBoss threads were stuck on a getResultList(), using 100% of the CPU.
Here is the stack for each of the threads :
{noformat}
Thread: http-0.0.0.0-8080-2 : priority:5, demon:true, threadId:156, threadState:RUNNABLE
java.util.HashMap.put(HashMap.java:374)
org.hibernate.engine.StatefulPersistenceContext.addCollection(StatefulPersistenceContext.java:787)
org.hibernate.engine.StatefulPersistenceContext.addUninitializedCollection(StatefulPersistenceContext.java:756)
org.hibernate.type.CollectionType.getCollection(CollectionType.java:642)
org.hibernate.type.CollectionType.resolveKey(CollectionType.java:430)
org.hibernate.type.CollectionType.resolve(CollectionType.java:424)
org.hibernate.engine.TwoPhaseLoad.initializeEntity(TwoPhaseLoad.java:139)
org.hibernate.loader.Loader.initializeEntitiesAndCollections(Loader.java:877)
org.hibernate.loader.Loader.doQuery(Loader.java:752)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:67)
{noformat}
I've seen some similar problems here
[
JGRP-525|https://issues.jboss.org/browse/JGRP-525] and here
[
JBMESSAGING-1676|https://issues.jboss.org/browse/JBMESSAGING-1676] and they are talking
about concurrency ...
--
This message is automatically generated by JIRA.
For more information on JIRA, see:
http://www.atlassian.com/software/jira