-->
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.  [ 2 posts ] 
Author Message
 Post subject: Thread waiting on condition
PostPosted: Mon Jan 02, 2017 6:04 am 
Newbie

Joined: Mon Jan 02, 2017 5:47 am
Posts: 2
Hello,

Since upgrading hibernate to 5.2.6 I am having issues starting my webapp which runs on tomcat. I get lots of these threads hanging on statup and eventually runs out of pool threads and hans the server. It does not happen all the time but when the server is under load ie running slowly and when booting up seems to make it worse. I have not changed my code for ages other than updating all the queries to CriteriaBuilder.

I have upgraded to tomcat 8.5.9 and the jdk8 to v112 and changed the pool to from commons.dbcp to commons.dbcp2 but has made no difference. I have been through my code and cannot find anything that would cause it to wait.

Any ideas how I can find out what it is waiting on?

Here is the a dump of the thread:

"ajp-nio-8009-exec-31" #63 daemon prio=5 os_prio=0 tid=0x000000001a9f7800 nid=0xf63 waiting on condition [0x00002afd5f0c6000]
java.lang.Thread.State: WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000d1042c50> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
at org.apache.commons.pool2.impl.LinkedBlockingDeque.takeFirst(LinkedBlockingDeque.java:583)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:442)
at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
at org.apache.commons.dbcp2.PoolingDataSource.getConnection(PoolingDataSource.java:134)
at org.apache.commons.dbcp2.BasicDataSource.getConnection(BasicDataSource.java:1533)
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
at org.hibernate.internal.NonContextualJdbcConnectionAccess.obtainConnection(NonContextualJdbcConnectionAccess.java:35)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.acquireConnectionIfNeeded(LogicalConnectionManagedImpl.java:99)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getPhysicalConnection(LogicalConnectionManagedImpl.java:129)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.getConnectionForTransactionManagement(LogicalConnectionManagedImpl.java:247)
at org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl.begin(LogicalConnectionManagedImpl.java:254)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.begin(JdbcResourceLocalTransactionCoordinatorImpl.java:203)
at org.hibernate.engine.transaction.internal.TransactionImpl.begin(TransactionImpl.java:56)
at org.hibernate.internal.AbstractSharedSessionContract.beginTransaction(AbstractSharedSessionContract.java:401)
at sun.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.hibernate.context.internal.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:355)
at com.sun.proxy.$Proxy65.beginTransaction(Unknown Source)
at org.events.business.hibernate.HibernatePersistenceStrategy.getSession(HibernatePersistenceStrategy.java:99)
at org.events.business.hibernate.HibernateWebsiteManagerImpl.getWebsiteDetailByHandle(HibernateWebsiteManagerImpl.java:319)
at org.events.business.WebsiteManagerImpl.getWebsiteByHandle(WebsiteManagerImpl.java:252)
at org.events.business.WebsiteManagerImpl.checkWebsiteByHandle(WebsiteManagerImpl.java:170)
at org.events.ui.rendering.WebsiteRequestMapper.isWebsite(WebsiteRequestMapper.java:389)
at org.events.ui.rendering.WebsiteRequestMapper.handleRequest(WebsiteRequestMapper.java:118)
at org.events.ui.rendering.filters.RequestMappingFilter.doFilter(RequestMappingFilter.java:107)
.......

Cheers Greg


Top
 Profile  
 
 Post subject: Re: Thread waiting on condition
PostPosted: Sat Jan 07, 2017 6:51 am 
Newbie

Joined: Mon Jan 02, 2017 5:47 am
Posts: 2
I have since resolved this by increasing the jdcb pool size and connector options. I was using the default which turns out to be 8.

Cheers


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.