Skip to content

{ Tag Archives } hibernate

Execute SQL outside of a transaction in Hibernate

I hit upon a snag today — while PostgreSQL requires that certain maintenance commands (e.g. vacuum analyze) are executed outside of a transactional context, it’s actually quite hard to get at Hibernate’s underlying database connection directly. Each Session object has a connection() method which returns a JDBC connection object, but this actually turns out to [...]

Also tagged ,

What’s wrong with Hibernate, #4

Hibernate is supposed to allow you to write queries and manipulate data in the normal Java idiom. Which is true up to a point, and that point is almost five years in the past, when Java introduced generics. Generics are absolutely standard practice in Java these days, and have been for two (nearly three) versions. [...]

Also tagged

What’s wrong with Hibernate, #3

Unfortunately, open-source projects above a certain size seem to become victims of their own success. Many other excellent OSS products like Guice or CXF have user-centred mailing lists that the developers also read. These developers are generally very willing to help out with problems, and the users — having been treated kindly when they started [...]

Also tagged

What’s wrong with Hibernate, #2

On the Hibernate website (and elsewhere), one of the touted advantages of Hibernate over roll-your-own SQL is: Hibernate Core for Java generates SQL for you, relieves you from manual JDBC result set handling and object conversion, and keeps your application portable to all SQL databases. Well, not exactly. Many functions in HQL (Hibernate Query Language) [...]

Also tagged

What’s wrong with Hibernate, #1

The first in a series of missives on the subject of Hibernate. Disclaimer: I’m not out to bash Hibernate, nor do I fundamentally dislike it. In fact I think it’s an impressive piece of work, which is why I’m bothering to highlight some of its pitfalls, in the hope that this saves other people the [...]

Also tagged