perhaps if I write this down, I’ll remember it!

20090317

Dyslexia is an interesting issue to have, one of the few our scientists know so little about. I mean, our brain as a whole is still black-boxy for the large part, and how things like dyslexia really stand out as “simple” problems that our scientists have yet to solve.

I imagine it will become more complex as we head towards media-dyslexia. For example I suffer dyslexia of some sort when it comes to boolean logic; so I imagine my dyslexia is computer-media related. Whenever I mean to type “not equals” I end up doing equals. I catch myself pretty quickly and I have adapted the way I code, probably for the better, to avoid complex compound decisions such as:

if (!equals(test1) && (test2 || test 3 && test 4))

Try as I might these type of things always feel pot luck as to whether I get them right on the first attempt – usually taking three or four goes. I have found moving away from this type of complex compound boolean logic the safest option in the long run.

My second form of dyslexia isn’t at all akin to dyslexia at all – but I struggle to find another word that can describe it accurately that isn’t the term “plain stupid”. I subscribe to the singular named table school. I.e. user over users, campaign over campaigns. I recently discovered with Hibernate that leads to an interesting issue when being used with postgres.

I had a mapping table mapping my user object to the table USER. I quickly realized that hibernate couldn’t insert into this table because of the name, Will pointed out that you can quote the table name in hibernate, I changed my mapping to be "USER" (xml mapping file). All my other tables were lower case so I decided to add " before and after the table name. Now I had all upper case tables and my schema looked pretty.

I then deployed both web applications I’m working on at the same time and noticed that I got two sets of tables one set with capitalized names and one set with lower cased names (minus USER which was just the upper case variant). If I deployed my applications with a decent length of time in between (stop tomcat, drop database, create database, deploy one app, start tomcat, stop tomcat, deploy second app, start tomcat) I ended up with just upper case table names. I decided to see if this behaviour was the same if I lower-cased my table names, changed all my "TABLENAME" to "tablename" and deployed my applications at the same time – all lower case table names.

spooky.. huh.

I checked the logs and couldn’t see anything that really stood out at me. Googled a bit and couldn’t find anything either. Hopefully if you find this its because you have the same problem and this helps you. If not… thanks for reading this entry!

update: turns out you’re meant to use back ticks (`) to mark where hibernate should quote the table/column names for you.

Leave a Reply