[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6414) CPU spinning, stuck on getResultList()

Guenther Demetz (JIRA) noreply at atlassian.com
Fri Mar 2 05:07:56 EST 2012


    [ https://hibernate.onjira.com/browse/HHH-6414?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45787#comment-45787 ] 

Guenther Demetz commented on HHH-6414:
--------------------------------------

Im not familiar with Spring but the JavaDoc of OpenSessionInViewInterceptor make me doubt 
whether it is really opening a new session per request:

----------------------------------------------------------------------------------
This class is a concrete expression of the "Open Session in View" pattern, which is a pattern that allows for the lazy loading of associations in web views despite the original transactions already being completed. 
----------------------------------------------------------------------------------

If this pattern allows lazy loading of associations then it must re-use hibernate sessions instead to open a new session with each request. In such configuration the second request used the same session as the first request used.
Are you using OpenSessionInViewInterceptor.singleSession set to true or to false?



> 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

        


More information about the hibernate-issues mailing list