Quick Rant

Posted July 10, 2010

Just a quick rant today - I've been trying to use Tomcat 6 + Hibernate Persistence using NetBeans IDE 6.9 and so far, I am seriously unimpressed. In fact, aside from the Java language (which I enjoy programming in), the whole Java servlets system seems to be a fairly large mess.

Here's an example with regards to the IDE - editing any "configuration" file for the webapp will have some pretty bazaar side-effects. I was trying to switch between EclipseLink and Hibernate JPA, and suddenly my JSP files has no access to any of the taglibs. What do those have to do with each other? Absolutely nothing at all.

And when it comes to persistence - it seems to me that after all these years, there has been very little progress made in stability and predictability. Hibernate JPA seems incapable of detecting and recovering from a MySQL connection which has been closed by MySQL itself (automatically). This is a common thing for MySQL to do, and I know iBatis has a fix for it, but it seems nothing in the Java Persistence API to deal with it - your webapp just shits itself until you redeploy the webapp (or sometimes ever restart the server). Hardly useful in a production environment.

Given my recent time working in PHP, these sorts of things are really leaving a bad taste in my mouth. It really shouldn't be this difficult to do simple CRUD.

On top of all this, reading the Hibernate JPA for editing existing persisted objects says, basically, load - set values - flush EntityManager. Wrong-o!!! You keep getting an exception saying you're not in a transaction. So this begs the question if the retards writing the documentation have even bothered to test what they are writing out as the official guide. Clearly not. Instead, you have to manually start an EntityTransaction, do your changes, flush() and then commit().

So there we are - thus far, I am not enjoying this at all.

 


Follow up:

Okay, so Hibernate is complete fucked in it's logic here. If you're not in a transaction, you cannot persist your changes to an entity. However, if you commit a transaction, then Hibernate closes the connection! So what the flying fuck are you supposed to do?

Comments

There are no comments for this post.

No comments found

Add comment

Visit my Friends and Family

If you've enjoyed my site, please take a moment to visit my friends and family, many of whom have some interesting insights, and entertaining thoughts and ideas.