On Oct 28, 9:19 pm, Thomas Mueller <[email protected]>
wrote:
> Hi,
>
> I think comparison of large binary data (BLOBs) should be discussed in
> another topic. The new "lob in database" feature does now use a
> checksum (hash code), but not a cryptographic one. If the checksum
> matches, the content is compared (so that equal blocks are shared). I
> considered using a cryptographic checksum, but that could be added
> later as an option. In most cases it would slow down adding BLOBs too
> much I believe.

The word "hash code" immediately brought an idea: if a Java object to
be serialized overrides equals(), it must also override hashCode(),
which must be consistent with equals(). So if you stored that hash
code alongside with the object itself when storing OTHER types,
looking them up from the db using equals() comparison could be made
pretty fast, provided that the hashCode() of that particular class is
well-implemented: only instances where the hashcodes match need to be
actually unmarshaled and compared with equals(), like in a HashMap.

Don't know what to do with classes that use the default equlas() and
hashCode(), though.

Best Regards,
Joonas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to