-->
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: spool and .data threads created for each entity
PostPosted: Wed Apr 20, 2011 4:19 am 
Newbie

Joined: Tue Mar 24, 2009 1:09 pm
Posts: 14
Hi,

I have a spring integrated web application using JPA/hibernate 3. We have been having some memory performance issues and so connected JConsole to out test machine. Looking at the threads I noticed that we have a couple of threads per JPA entity, e.g.:

my.domain.EntityOne.data
my.domain.EntityOne Spool Thread

my.domain.EntityTwo.data
my.domain.EntityTwo Spool Thread

Does anyone know why on earth there are two threads being allocated for each entity? The EntityManager is a spring injected singleton entity manager which apparently sorts out the non threadsafe JPA EntityManager issues. But I cannot concieve it handles the EntityManager concurrency by creating a seperate thread for each entity/entityManager?

I have absolutly no idea what these threads are for. Any insight would be apprecieated.


Top
 Profile  
 
 Post subject: Re: spool and .data threads created for each entity
PostPosted: Wed Apr 20, 2011 4:28 am 
Newbie

Joined: Tue Mar 24, 2009 1:09 pm
Posts: 14
Just looked more closely and the sppol thread stack trace shows its associated with the ehcache diskstore. So thats explains that I guess.

But still dont understand the my.domain.EntityOne.data threads for each JAP entity.

Stack trace for these shoes a ThreadPoolExecutor:

tack trace:
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:146)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:1879)
java.util.concurrent.DelayQueue.take(DelayQueue.java:135)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:533)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:526)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:470)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
java.lang.Thread.run(Thread.java:637)


Dont know what created them or why it was created.


Top
 Profile  
 
 Post subject: Re: spool and .data threads created for each entity
PostPosted: Wed Jan 16, 2013 6:42 am 
Newbie

Joined: Wed Jan 16, 2013 6:34 am
Posts: 3
tim.taylor wrote:
Just looked more closely and the sppol thread stack trace shows its associated with the ehcache diskstore. So thats explains that I guess.
But still dont understand the my.domain.EntityOne.data threads for each JAP entity.

Tim,
These threads are created when the "overflowToDisk" property is enabled (which is the default).
They are started by a call to "ScheduledThreadPoolExecutor" in the "DiskStorageFactory" constructor.
They implement the "DiskExpiryTask".
Regards,
metatech


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.