-
1. Re: Should Fqns only contain String elements?
belaban Feb 9, 2007 6:56 AM (in response to manik)+1
-
2. Re: Should Fqns only contain String elements?
brian.stansberry Feb 9, 2007 10:45 AM (in response to manik)This would significantly affect the JBC/Hibernate integration, since Hibernate uses the primary key of an entity in its Fqn for the entity cache and a serialized form of a query as part of the Fqn in the query cache.
-
3. Re: Should Fqns only contain String elements?
manik Feb 9, 2007 11:17 AM (in response to manik)Yes, in it's current form this does become problematic, but can't string representations of the PK be used for the entity cache, and again something similar for the query cache?
-
4. Re: Should Fqns only contain String elements?
brian.stansberry Feb 9, 2007 12:54 PM (in response to manik)Only if an algorithm could be developed that could convert the PK/query to a String such that
if (pk1.equals(pk2)
assertTrue(pkToString(pk1).equals(pkToString(pk2)));
else
assertFalse(pkToString(pk1).equals(pkToString(pk2)));
always passes.
Or we come up with some thinking-out-of-the-box solution. :) -
5. Re: Should Fqns only contain String elements?
brian.stansberry Feb 9, 2007 12:56 PM (in response to manik)Hey, JBoss Cache community -- please don't interpret my above posts as settling this issue! Please provide your input to Manik's original question; it's very much wanted!
-
6. Re: Should Fqns only contain String elements?
genman Feb 9, 2007 2:08 PM (in response to manik)Non-String in FQN reasons:
1. I work with a lot of numbers and ranges. Converting from numeric to string and back again is inefficient and annoying.
2. Strings are bulky objects compared to Integer, especially in huge numbers.
3. Most CacheLoaders could support them. Admittedly this would require some work or restrictions.
For example, in the FileCacheLoader, you could simply use a PropertyEditor to convert the object to text and use this as the directory name. Store the PE used in the data file. Then, use a PropertyManager to convert the directory name back to an Object.
For BDB, convert the FQN to a byte array using serialization.
4. I would be nice to use package-private objects in FQN that would be invisible to the user to restrict data access. This is better than crafting strings that look like __HIDDEN_DATA_DO_NOT_TOUCH_PLEASE__ .
Allowing null in FQN does suck and there are probably some bugs in JBC handling them. That's a different thread perhaps. -
7. Re: Should Fqns only contain String elements?
genman Feb 19, 2007 12:55 PM (in response to manik)Also: For PojoCache, the collections wrappers currently use numbers for array indicies and hash codes. These numbers are part of the FQN, and have to be converted to Strings.
I really would like at least String and Integer/Long to work with Fqn. I don't really see too much value for floating points in Fqn. Enum would be nice as well. -
8. Re: Should Fqns only contain String elements?
manakhan Mar 30, 2007 2:50 PM (in response to manik)int / long / string would support all our foreseeable needs, mostly for convenience again on the first two ... primarily we use strings and use jbosscache as a standalone with our own socket server in front of it, so string only would be OK too
-
9. Re: Should Fqns only contain String elements?
aditsu Aug 11, 2007 10:43 AM (in response to manik)I'm not sure if this is still relevant now, but here's my opinion anyway:
I generally agree with genman; at the very least, I think the cache should accept String and Integer elements.
Ideally, it should also support Long, Double, Date and enums.