jakarta-jcs-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jxiao <jx...@3ht.com>
Subject Re: store BLOB in the cache
Date Fri, 31 Aug 2007 19:32:37 GMT

Hi: 
I think I need explain more about the problem I have since the cause of
problem might not be what I think.
The project I am working on is web application. User can download the files
(MS word, PDF etc)by clicking the link on the site. Those files are stored
in Database as Blob. The purpose of my code is to cache the Blob in the
memory and spool to disk if max memory size exceed.
I got the following exception automatically, after MaxMemoryIdleTimeSeconds
of the cached Blob has reached. The following is my ccf configuration and
exception . 
# DEFAULT CACHE REGION

jcs.default=DC
jcs.default.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.default.cacheattributes.MaxObjects=1000
jcs.default.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache

# PRE-DEFINED CACHE REGIONS

#Special Cache
jcs.region.SpecialCache=DC
jcs.region.SpecialCache.cacheattributes=org.apache.jcs.engine.CompositeCacheAttributes
jcs.region.SpecialCache.cacheattributes.MaxObjects=1000
jcs.region.SpecialCache.cacheattributes.MemoryCacheName=org.apache.jcs.engine.memory.lru.LRUMemoryCache
jcs.region.SpecialCache.cacheattributes.UseMemoryShrinker=true
jcs.region.SpecialCache.cacheattributes.MaxMemoryIdleTimeSeconds=300
jcs.region.SpecialCache.cacheattributes.ShrinkerIntervalSeconds=60
jcs.region.SpecialCache.cacheattributes.MaxSpoolPerRun=500
jcs.region.SpecialCache.elementattributes=org.apache.jcs.engine.ElementAttributes
jcs.region.SpecialCache.elementattributes.MaxLifeSeconds=600
jcs.region.SpecialCache.elementattributes.IsEternal=false


# AVAILABLE AUXILIARY CACHES
jcs.auxiliary.DC=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheFactory
jcs.auxiliary.DC.attributes=org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCacheAttributes
jcs.auxiliary.DC.attributes.DiskPath=c:/devjcs/raf
jcs.auxiliary.DC.attributes.maxKeySize=5000

IndexedDiskCache.doUpdate(508)- Region [SpecialCache] Failure updating
element, key: SpecialCache:DocTemplates:807 old: null
java.io.NotSerializableException: oracle.jdbc.driver.T4CConnection
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1054)
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
	at java.util.HashMap.writeObject(HashMap.java:978)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:324)
	at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:809)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1296)
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
	at
java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1332)
	at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1304)
	at
java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1247)
	at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1052)
	at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:278)
	at
org.apache.jcs.utils.serialization.StandardSerializer.serialize(StandardSerializer.java:50)
	at
org.apache.jcs.auxiliary.disk.indexed.IndexedDisk.serialize(IndexedDisk.java:288)
	at
org.apache.jcs.auxiliary.disk.indexed.IndexedDiskCache.doUpdate(IndexedDiskCache.java:430)
	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)


jxiao wrote:
> 
> Hi:
> Is there any way we can store BLOB in the cache using Index disk cache as
> aux cache? I understand the cache object has to be serializable object and
> blob in Jave 1.4 is not. Is there anyway to work around? Please help!
> Thank you very much in Advance.
> 

-- 
View this message in context: http://www.nabble.com/store-BLOB-in-the-cache-tf4360106.html#a12432631
Sent from the JCS - Users mailing list archive at Nabble.com.


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


Mime
View raw message