Tag Archives: Hibernate

SQL Server – The Best Database in the World

OK, that’s maybe overstating it a bit, but I do think that the tools that come with SQL Server are very developer friendly. Take, for instance, the SQL Profiler. I find that this is particularly useful when writing any code that accesses databases, or for diagnosing database problems.

If you’re using Hibernate (and probably other libraries as well), you can get the sql dumped out to the console that is being executing. This is very useful most of the time, but it doesn’t contain the physical SQL that is going to be executed. It generally replaces the values from prepared statements with ‘?’s.

For debugging SQL related work its often invaluable to see the exact SQL that is being performed and on what connection – this can allow you to easily identify any potential database locking problems.

Running a SQL profile trace also allows you to see how long each query is taking and allows you to identify any potential bottlenecks in your application.

I know you can do similar things in Oracle (in version 9 at least – I’ve not seen 10 yet), but they’re just not as developer friendly. I’m not knocking Oracle, I think its a fantastic database also, however I feel it is let down by its developer toolset.

UML Diagrams for Hibernate

I’ve just found this linked to from the Hibernate home page. It looks kinda cool.

Linguine Maps for Hibernate is an open-source utility that will automatically produce easy to read UML-style entity-relation diagrams from Hibernate mapping files.

 

Book Review: Better, Faster, Lighter Java

Better, Faster, Lighter Java

I’ve just finished reading this book by Bruce Tate and Justin Gehtland. Its one of the best books I’ve read for a long time and I thoroughly recommend it.

The book begins by explaining how Java development has gotten too complex and how often too many “bloated” frameworks are used for solving enterprise Java problems. The authors describe how simplicity is often the best approach to writing applications (quote: “simplicity is the hallmark of a well written application”). There then follow 5 idioms for writing better code with a chapter describing each of these in detail.

Next there is a chapter each on the Spring Framework and on Hibernate showing how these 5 idioms have successfully been applied to these popular frameworks and giving an overview of how they can be used.

Finally, there are a couple of chapters bringing all this new knowledge together and showing some example code.

I thoroughly recommend this book to anyone doing Enterprise J2EE development.

Hibernate 3.0 final released

The latest production version of Hibernate (3.0) was released yesterday. According to the Hibernate web site, this contains minor fixes and some new functionality including two new database dialects.

I’ve been using the 3.0RC1 since its release and found it to be stable. The change log to version 3.0 lists the bugs and new features added so I’d recommend people using Hibernate have a look at this and then upgrade.