Hi all,

<snip intro>
> The only way to 
> access a cached object without going
> through its Identity is basically (as I think Charles also 
> mentioned) to implement your own cache and key it on whatever 
> unique criterion other than Identity you wish to use. We have 
> a similar requirement on our project, and ended up having our 
> own extra cache. 

pluging in user defined caches is very easy in OJB. See
http://jakarta.apache.org/ojb/objectcache.html.

> Bit of a pain, as the object usually exists 
> in the OJB cache but you can't
> get at it if you don't have the Identity (which you can only 
> build based on PKs) so you end up duplicating things. I can't 
> help feeling there is a better solution, maybe some kind of 
> cache partitioning based on different key objects, but I 
> don't have time to think about that just now (and I'm 
> probably not smart enough anyway...).

Of course this is possible. 
You will end up implementing index structures on the cache that allows to
select element via certain criteria.
In other words you are reimplementing mechanisms that are already
implemented in the RDBMS.

That's the reason why all O/R tools that I know of don't implement such a
feature but delegate it to the RDBMS which is optimized for such queries!

cheers,
Thomas

> 
> Cheers,
> 
> Chris
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ojb-user-help@;jakarta.apache.org>
> 
> 


--
To unsubscribe, e-mail:   <mailto:ojb-user-unsubscribe@;jakarta.apache.org>
For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>

Reply via email to