Friday, October 08, 2004

Spring Rich Client Project

Yesterday I was attending a Spring Framework seminar arranged by Objectware. They had invited Keith Donald from Interface21 to do a full day presentation. I have been using Spring for quite some time now, so I didn't learn anything new, except for one thing: The Spring Rich Client subproject, founded by Keith.

It has been a while since the last time I wrote a Swing application but after this presentation I would not mind getting my hands dirty again. What it provides is a nice abstraction layer above the Swing API, the same as the "Core" Spring Framework does for the J2EE API's. Nice :-)



Monday, October 04, 2004

Hibernate, PostgreSQL and Spring

Puh.. After couple of hours swearing at this problem, I finally found what caused the error. The problem was that when trying to insert data in a PostgreSQL table I kept getting errors for some of the rows I was trying to insert. The error message returned from Hibernate was something like "data integrity violated by SQL 'null'…" blah blah blah "… Call getNextException() to see the cause". The Spring Framework data access exception was reporting a DataIntegrityViolationException.

I therefore assumed that the problem had to do with the quality of the data I was attempting to insert, such as null values. The suspicion did not get any less by the fact that the source of the data was read from an Excel spreadsheet using POI.

When I finally got to my senses and traced the Hibernate code, I was able to see the "next exception", which did NOT have anything to do with null values. The problem was that once in a while the value of one cell contained a string of six characters instead of five as defined in the database schema :-( It would be nice if Hibernate could include this information in the returned error message. Please Gavin!

I have recently converted from MySQL to PostgreSQL, after been lobbied by Thomas Roka-Aardal and have found that PostgreSQL is much more intolerant and strict than MySQL, but after all I think that is OK.

Friday, October 01, 2004

Static hell!

Where does it say that factories classes only should have static methods? Nowhere, but somehow it seems to be the rule. Why am I complaining about this, you may ask? After one week trying to reuse some of the legacy code at work (written one month ago :-) I am getting quite frustrated trying to write tests for the new functionality I am adding. But now, after a half day of refactoring the code, I have managed to get rid of the problem. For now…

Wednesday, September 29, 2004

At last, I have a blog as well

Since my friend, Trond already has a blog, I guess I should get one also :-)