[jboss-user] [JBossCache] - Re: Blob balancer using cache - concept help

manik.surtani@jboss.com do-not-reply at jboss.com
Tue Aug 22 13:33:06 EDT 2006


"zambak" wrote : 
  | 
  | 1) Since image will be uploaded and stored in the DB via admin part, can I use the same BLOB column when I configure JDBC based cache loader. I mean are the BLOBs compatible (as in case with File cache loader the map is serialized so image file and cached file are not the same, is it same true for JDBC loader?) If they are not compatible, then I am going to have to waste some DB space (duplicate BLOBS in DB one BLOB is app specific, one is for cache right?).... 
  | 
  | 

This is irrelevant since you will always be using the cache to read or write the contents of that blob.  The reason it was a problem with the File Cache Loader was that you were trying to serve up the file directly using your webserver.

"zambak" wrote : 
  | 2) In order to evict an item when a new image with a same name is uploaded (an update) will I need to have a listener perform this action logic?
  | 
  | If I understand this correctly, the listener would add/remove/update blobs in the cache every time admin action adds/removes/updates an image. Then we rely on cache achitecture to propagate same behavior across the cluster.
  | 
  | So we have add/update/remove image (in admin)
  | 
  | 1) store/restore/reupdate image as a BLOB in DB (depending on concern outlined in #1)
  | 2) add image as byte[] to cache
  | 3) action in #2 will notify the listeners on all nodes and recreate/remove image from byte[] onto a disk
  | 

Your admin tool (I presume this to be a servlet or JSP) would add/remove/update the image in the CACHE only (as a byte[]).   Not directly in the DB.  The cache will make sure this is persisted to the DB if you have a JdbcCacheLoader configured.

A cache listener - registered with the cache - will be responsible for creating a file on the filesystem, with the name and byte[] in the cache.

The cache listener should do this whenever the cache is modified or created.  




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3966760#3966760

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3966760



More information about the jboss-user mailing list