You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jcs-users@jakarta.apache.org by Tore Halset <ha...@pvv.ntnu.no> on 2007/10/12 10:07:31 UTC

shutdown

Hello.

My JCS live in a WAR deployed in JBoss. I am trying to shutdown my  
disc based JCS during redeployment. To do this, I have a servlet  
Filter that has the following method. Is this the best way to detect  
undeployment?

public void destroy() {
   if(!jcsdown) {
   CompositeCacheManager compositeCacheManager =  
CompositeCacheManager.getInstance();
   compositeCacheManager.release();
   compositeCacheManager.shutDown();
   jcsdown = true;
  }
}

It looks like the cache are shut down and the .key are updated. The  
object in memory are however not spooled to disc. JCS logs the  
following exception.

09:54:11,594 ERROR [IndexedDiskCache] Region [myRegion] Failure  
updating element, key: myKey old: null
java.lang.InterruptedException
         at  
EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock 
$WriterLock.acquire(WriterPreferenceReadWriteLock.java:234)
         at  
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate 
(IndexedDiskCache.java:433)
         at org.apache.jcs.auxiliary.disk.AbstractDiskCache 
$MyCacheListener.handlePut(AbstractDiskCache.java:603)
         at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun 
(CacheEventQueue.java:688)
         at org.apache.jcs.engine.CacheEventQueue 
$AbstractCacheEvent.run(CacheEventQueue.java:607)
         at org.apache.jcs.engine.CacheEventQueue$QProcessor.run 
(CacheEventQueue.java:575)

What should I do to make the object in memory spooled to disc during  
shutdown and prevent this InterruptedException?

Attached is the complete log output.

Regards,
  - Tore.


09:54:11,182 INFO  [CompositeCache] In DISPOSE, [myRegion] fromRemote  
[false]
Region Name = myRegion
HitCountRam = 0
HitCountAux = 0
---------------------------LRU Memory Cache
List Size = 1
Map Size = 1
Put Count = 1
Hit Count = 0
Miss Count = 1
---------------------------Indexed Disk Cache
Is Alive = true
Key Map Size = 0
Data File Length = 0
Hit Count = 0
Bytes Free = 0
Optimize Operation Count = 0
Times Optimized = 0
Recycle Count = 0
Recycle Bin Size = 0
Startup Size = 0
Purgatory Hits = 0
Purgatory Size = 0
Working = true
Alive = false
Empty = true
Size = 0
09:54:11,182 INFO  [CompositeCache] In DISPOSE, [myRegion] auxiliary  
[org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache@6d3ac6]
09:54:11,183 INFO  [CacheEventQueue] Cache event queue created:  
CacheEventQueue [listenerId=-1825356115, cacheName=myRegion]
09:54:11,184 INFO  [CompositeCache] In DISPOSE, [myRegion] put 1 into  
auxiliary org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache@6d3ac6
09:54:11,285 INFO  [AbstractDiskCache] No longer waiting for event  
queue to finish: Cache Event Queue
Working = true
Alive = true
Empty = true
Size = 0
09:54:11,285 INFO  [AbstractDiskCache] In dispose, destroying event  
queue.
09:54:11,285 INFO  [CacheEventQueue] Destroying queue, stats =  Cache  
Event Queue
Working = true
Alive = false
Empty = true
Size = 0
09:54:11,286 INFO  [CacheEventQueue] Cache event queue destroyed:  
CacheEventQueue [listenerId=-1825356115, cacheName=myRegion]
09:54:11,594 ERROR [IndexedDiskCache] Region [myRegion] Failure  
updating element, key: myKey old: null
java.lang.InterruptedException
         at  
EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock 
$WriterLock.acquire(WriterPreferenceReadWriteLock.java:234)
         at  
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate 
(IndexedDiskCache.java:433)
         at org.apache.jcs.auxiliary.disk.AbstractDiskCache 
$MyCacheListener.handlePut(AbstractDiskCache.java:603)
         at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun 
(CacheEventQueue.java:688)
         at org.apache.jcs.engine.CacheEventQueue 
$AbstractCacheEvent.run(CacheEventQueue.java:607)
         at org.apache.jcs.engine.CacheEventQueue$QProcessor.run 
(CacheEventQueue.java:575)
09:54:11,690 INFO  [IndexedDiskCache] Region [myRegion] Shutdown  
complete.
09:54:11,690 INFO  [CompositeCache] In DISPOSE, [myRegion] disposing  
of memory cache.
09:54:11,690 INFO  [AbstractMemoryCache] Memory Cache dispose  
called.  Shutting down shrinker thread if it is running.
09:54:11,691 INFO  [CompositeCache] In DISPOSE, [myRegion] fromRemote  
[false]
Region Name = myRegion
HitCountRam = 0
HitCountAux = 0
---------------------------LRU Memory Cache
List Size = 0
Map Size = 0
Put Count = 1
Hit Count = 0
Miss Count = 1
---------------------------Indexed Disk Cache
Is Alive = false
Key Map Size = 0
Data File Length = -1
Hit Count = 0
Bytes Free = 0
Optimize Operation Count = 0
Times Optimized = 0
Recycle Count = 0
Recycle Bin Size = 0
Startup Size = 0
Purgatory Hits = 0
Purgatory Size = 0
Working = true
Alive = false
Empty = true
Size = 0





---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: shutdown

Posted by Tore Halset <ha...@pvv.ntnu.no>.
Hello.

Thanks for the tip. It was cleaner than my previous solution, but  
behaves the same. Shutdown of JBoss works, but redeploy gives the  
following message.

09:54:11,594 ERROR [IndexedDiskCache] Region [myRegion] Failure  
updating element, key: myKey old: null
java.lang.InterruptedException
         at  
EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock 
$WriterLock.acquire(WriterPreferenceReadWriteLock.java:234)
         at  
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate 
(IndexedDiskCache.java:433)
         at org.apache.jcs.auxiliary.disk.AbstractDiskCache 
$MyCacheListener.handlePut(AbstractDiskCache.java:603)
         at org.apache.jcs.engine.CacheEventQueue$PutEvent.doRun 
(CacheEventQueue.java:688)
         at org.apache.jcs.engine.CacheEventQueue 
$AbstractCacheEvent.run(CacheEventQueue.java:607)
         at org.apache.jcs.engine.CacheEventQueue$QProcessor.run 
(CacheEventQueue.java:575)

Perhaps the problem is my old JBoss installation? I am using 4.0.3..

Regards,
  - Tore.

On Oct 28, 2007, at 18:21 , Thomas Vandahl wrote:

> Tore Halset wrote:
>> Hello.
>>
>> My JCS live in a WAR deployed in JBoss. I am trying to shutdown my  
>> disc
>> based JCS during redeployment. To do this, I have a servlet Filter  
>> that
>> has the following method. Is this the best way to detect  
>> undeployment?
>
> See
> http://jakarta.apache.org/jcs/apidocs/org/apache/jcs/utils/servlet/ 
> JCSServletContextListener.html
>
> Does that behave different?
>
> Bye, Thomas.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jcs-users-help@jakarta.apache.org
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org


Re: shutdown

Posted by Thomas Vandahl <tv...@apache.org>.
Tore Halset wrote:
> Hello.
> 
> My JCS live in a WAR deployed in JBoss. I am trying to shutdown my disc
> based JCS during redeployment. To do this, I have a servlet Filter that
> has the following method. Is this the best way to detect undeployment?

See
http://jakarta.apache.org/jcs/apidocs/org/apache/jcs/utils/servlet/JCSServletContextListener.html

Does that behave different?

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: jcs-users-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jcs-users-help@jakarta.apache.org