All posts by Tom

Linear Block Allocator – a superior alternative to Hi/Lo

While SQL & Hibernate are mostly portable, one crucial area remains subject to incompatibility. Primary keying is the foundation of our tables, but key allocation is non-standard.

Most other SQL elements are standard & compatible, especially with the help of Hibernate. Joins, columns, mappings & queries will generally port without a hitch.

But when we get to identifier generation, the picture falls apart. Some databases use auto-increment/  identity columns, others sequences. Syntaxes differ, retrieving generated keys is variable at best. With such divergence, how can we possibly allocate keys portably? Continue reading

Logging — our most effective debugging tool?

Logging frameworks have become a standard part of projects, since Servlets and Log4J first emerged. But how should we log? Are we getting the most we can from it?

Many developers see logging & debugging as separate tasks. When confronted with a problem we set breakpoints, step through, inspect variables, and trace through loops – often finishing hours later..

Finding problems this way is hard. Does it have to be so difficult? Could there be a way to get right to the problem area, in just minutes? Sometimes without even needing to step through? Continue reading

Fuzzy String Search in SQL

Users often enter data approximately or inaccurately.. But sometimes, we need to search or match this inaccurate data anyway!

For example, users should match existing customer records rather than creating unwanted duplicates.

There are standard algorithms for measuring string-distances, but we’ll need a few extra steps to make this work efficiently against a database..  Continue reading