SQL Zone is brought to you in partnership with:

Astrid has posted 2 posts at DZone. View Full User Profile

Here's what I mean by "Hibernate's exceptions are useless"

  • submit to reddit
Your rating: None Average: 3.3 (3 votes)
Published at DZone with permission of its author, Astrid Training.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)


Damien Lepage replied on Thu, 2011/11/17 - 4:49pm

Wouldn't opening a ticket for the hibernate folks be more useful than writing a blog post?

Nicolas Frankel replied on Thu, 2011/11/17 - 4:52pm in response to: Damien Lepage

+1 (cf. a former rant on giving back to the community)

matt inger replied on Thu, 2011/11/17 - 11:17pm

Also, it's possible that connection is not even needed. There's some situations in which you're not connecting. I believe that the query generation phase (insert, update, delete queries for objects) takes place before a connection is established. This means that a SQL dialect must be specified so that it knows how to generate those statements. Also DDL generation might have the same situation. I don't know the code inside and out, but i image this could be case. I agree the error message is a little odd, but i can understand why it might need the dialect there. Again, this is better filing a ticket on the project, so you can get an explanation from the devs, and just maybe get it fixed.

Dapeng Liu replied on Fri, 2011/11/18 - 4:36am

i was also bitten by this took me a good time figure out what was real problem after that my brain works incredibly well to translate this error automatically to ConnectionError!

Loren Kratzke replied on Fri, 2011/11/18 - 4:11pm

Given that I am not a big fan of Hibernate, and respect the tactic of public humiliation in this case when I am almost certain that there is a bug on this already (come on, no database connection, that has to happen quite often), I would just like to point out that this post was on topic and could be considered good guidance for anybody considering using Hibernate. I would call that "giving back to the community", the community that is considering using Hibernate. It's all good in that respect.

After all, no error message at all is better than one that sends you down a rabbit hole with no hope of finding the problem. Isn't Hibernate all about saving time and effort?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.