[jboss-dev-forums] [Design of JBossCache] - Re: Implicit marshalled values - a better way of handling re

jason.greene@jboss.com do-not-reply at jboss.com
Fri Dec 21 01:03:03 EST 2007


"manik.surtani at jboss.com" wrote : 
  | about double classloader-specific marshalling.  Even if region-based marshalling is off, there will still be double-marshalling, i.e., Pojo -> a byte[] in your MarshalledValue, which is put in the cache.  The CacheMarshaller then marshalls your MarshalledValue into a (bigger) byte[] for replication.  Or is there something clever in your MarshalledValue class that just passes the byte[] payload in writeExternal()?
  | 

This is how it should be done if its not already.

anonymous wrote : 
  | True.  Maybe just the TCCL approach would work then.
  | 

Yes, this is the simplest, cleanest way.


anonymous wrote : 
  | "bstansberry at jboss.com" wrote : 
  |   | I'll need to find my scribbled design notes from when I thought about shared HTTP sessions, but I know that one thing that came out of my thinking was a need to flush the type system by converting everything back to a byte[].  This would be done on a redeploy, where we want to preserve cached data but the types are no longer usable. The MarshalledValue impl I was thinking of would have a method for that. I was assuming the session managment layer would walk the tree, get the marshalled values and invoke the "flush" method on them; if this is instead an internal detail of JBC there would need to be an API (probably on Node) to tell it to do the same thing.
  |   | 
  | 
  | Hmm.  Let me think about it, but I can't really see a way for this to happen automatically.  It would have to be an API call.
  | 

I think this is very useful. I think it needs a better name than flush though. Maybe releaseObjectReferences(fqn) or something like that.

anonymous wrote : 
  | "bstansberry at jboss.com" wrote : 
  |   | 2) For collections, should probably just use it rather than doing something like trying to determine the type of all collection elements.
  |   | 2) Perhaps its a behavior that should be cache-wide configurable. So, if I'm storing a bunch of Sets whose elements are all Strings, I could turn this off.
  | 
  | Yes, there should always be a way to disable this and allow manual spinning of marshalled values.  I'd enable it by default though just to allow for lazy unmarshalling.
  | 

I agree, this behavior should be the default. The overhead is minor (temporary double buffer).

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

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



More information about the jboss-dev-forums mailing list