[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Object query language?



On Mon, 20 Mar 2000, William Uther wrote:
> --On Monday, March 20, 2000 1:46 PM +0100 Falko Braeutigam 
> <falko@softwarebuero.de> wrote:
> 
> >> I was expecting the ODMG collections to be disk based and hence of
> >> arbitrary size.
> >
> > This is definitely a goal of the ozone collections but this is not
> > defined by ODMG. In fact, it seems that no other ODMG vendor has real
> > scalable (disk based) ODMG collections.
> 
> Interesting - I didn't know.
Objectivity does not have ODMG collection at all and the ObjectStore
implementation that I have seen just forwards the calls to the java.util
implementation.

> 
> > The work of creating the 'cache' object needs to be done ones, where the
> > proxies effects each method call!
> 
> Yes, but objects are only inserted into the hashtable once.  That is the 
> only time hashCode() is called.  When you want to get() an object you're 
> going to have to make a new key object - this is going to be as expensive 
> as the proxy call.
> 
> > However, if the database object is used as a key its hashCode() value
> > must not change. So you may also compute the hashCode() once and use this
> > non-database object as key.
> 
> Not quite.  hashCode() values must not change within a VM instance.  They 
> are allowed to change between VM instances.  This is why the hashtable has 
> to re-add all the keys individually during deserialization.  Currently the 
> hashCode() method of my key relies upon the hashCode() methods of some 
> other objects.  Those other hashCodes may change when those objects are 
> re-loaded causing my hashCode to change.
> 
> > I can add some code to a maybe generated hashCode() method of the proxies
> > that checks if the objects is just serialized and return the default
> > hashCode in that case. Sounds extremly hackish but should work.
> 
> I specifically do not want the default hashCode() - I overrode it for a 
> reason.  Using the default hashCode() would stop the hashtable from 
> indexing what I want it to index.
The Java serialization calls the hashCode() of the serialized objects to find
out what objects are already serialized. (so the Java serialization code should
use System.identityHashCode()) This should not depend on your code. The default
hashCode() should work. It would change behaviour only when serialized!

> 
> I will take a closer look at the Ozone proxy serialization code when I get 
> back to CMU.  I think I can re-write it to work correctly in this case.
Great.


Falko
-- 
______________________________________________________________________
Falko Braeutigam                         mailto:falko@softwarebuero.de
softwarebuero m&b (SMB)                    http://www.softwarebuero.de