[jbosscache-dev] Need for CacheLoader.storeState?

Manik Surtani manik at jboss.org
Fri Sep 1 05:26:00 EDT 2006


Yeah, I'm with Elias here that this does make things confusing.  I  
vote for throwing an exception if a cache loader method is called  
with a non-String Fqn and the cache loader in question only supports  
Strings.

I don't think we can get rid of non-String based Fqns altogether  
though, a lot of use cases (esp. Hibernate) use non-String components  
in Fqns.

Regarding storing String based Fqns on a file system, see JBCACHE-644

Cheers,
--
Manik Surtani

Lead, JBoss Cache
JBoss, a division of Red Hat

Email: manik at jboss.org
Telephone: +44 7786 702 706
MSN: manik at surtani.org
Yahoo/AIM/Skype: maniksurtani


On 1 Sep 2006, at 07:32, Elias Ross wrote:

> Bela Ban wrote:
>> Okay. We can actually say that FQNs can only have strings as  
>> components, which is a requirement for some cache loaders anyway  
>> (JDBC for instance)
>
> The JDBM cache loader I worked on allowed for FQNs composed of any  
> object, including "null" of course.  I believe a unit test checked  
> if null was supported.
>
> I'm not sure allowing for any object is a useful feature for most  
> or any customer, but it's the least astonishing for the user.  I  
> recall a forum thread that had one customer wondering why their  
> data wasn't coming back because FQN components were converted to  
> strings upon store.
>
> And then there's the question of how to appropriately store and  
> restore null strings.  I also wonder about FQNs with "/" or null  
> characters in them, in a file system context they need to be escaped.
>
> When working with a text column, it might make sense to convert non- 
> strings to a Java serialized, Base-64 string.  Or, if the DB  
> supports it, simply store FQNs serialized in a short byte array or  
> blob.
>
> At the very least, throwing out an exception for non-strings during  
> store makes a lot of sense.
> _______________________________________________
> jbosscache-dev mailing list
> jbosscache-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosscache-dev




More information about the jbosscache-dev mailing list