Daniel,
To be honest your problem is one of general data/object structures, not the 
cache. As Ben already pointed out, you're asking the cache to do something 
different than what plain old Java does. Personally, I think the cache should 
retain the same semantics as Java (ie. placing two different objects into the 
cache will always result in two different objects being retrieved from the 
cache).

In order to do what you're asking you're going to have to change your 
data/object structure. This is the best way, as then your code won't break when 
you suddenly take away the cache. So, for example, you could simply store the 
address ID in the Person object, and then use that to look up the actual 
Address object. This could potentially all be handled by the Person object 
itself (looking up the Address object when getAddress() is called), hiding the 
details from the caller.

Thinking along a general data structures line will lead you to a much more 
robust solution.

Tim

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

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


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
JBoss-Development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to