-
1. Re: Associating multiple keys with same object without stori
manik Nov 29, 2006 9:49 AM (in response to haribaasha)Well, what is stored is an object reference in memory, so in that regard you don't store it twice. However, there is overhead for each node you create. Plus, if you have a cache loader, then a copy is made to disk and you will have the overhead.
-
2. Re: Associating multiple keys with same object without stori
genman Nov 29, 2006 10:19 PM (in response to haribaasha)I believe the Pojo cache takes care of the referencing issues? So, you should only have a single copy of the object persisted.
-
3. Re: Associating multiple keys with same object without stori
haribaasha Nov 29, 2006 10:28 PM (in response to haribaasha)yep, the reference is only stored, but i am also writing it to file, cant do anything there, just have to write it twice..
thanks guys
hari -
4. Re: Associating multiple keys with same object without stori
ben.wang Nov 30, 2006 4:08 AM (in response to haribaasha)PojoCache has the restriction of not doing ref counting for primitive type now, e.g., we consider String as primitive since it is constant. So if you are referring only String type, then PojoCache won't do this for you.
-
5. Re: Associating multiple keys with same object without stori
haribaasha Nov 30, 2006 4:28 AM (in response to haribaasha)this is wat i use to get the treecache instance
MBeanServer server = MBeanServerLocator.locate();
TreeCacheMBean tree = ( TreeCacheMBean ) MBeanProxyExt.create( TreeCacheMBean.class, "jboss.cache:service=TreeCache", server );
the object i am caching is a string , with a string as key.. -
6. Re: Associating multiple keys with same object without stori
ben.wang Dec 2, 2006 9:05 PM (in response to haribaasha)Yeah, unless you are willing to wrap the String in abother helper class and use PojoCache to store the helper POJO, otherwise not much can be done there.