Nuances of open source technologies…

I have always faced these problems during last 4 years of J2EE development. This problem that I faced now, is an epitome of that.

1. I am using Hibernate3 with Weblogic. So I tried the new feature of delete HQL query. Steangely, it says…”org.hibernate.QueryException: query must begin with SELECT or FROM“.

2. Digging on this, I found this – http://forum.springframework.org/showthread.php?t=18732 which asked me to use the new HQL parsing version ASTQueryTranslatorFactory instead of ClassicQueryTranslatorFactory.

3. Upon using that, I found this , this and this (Weblogic issues).

4. To summarize, Weblogic uses some old version of a parsing library (antlr), and it loads that library before loading application. This prevents HB3 to see the new version of antlr, which is needed to parse this new kind of queries (HQL update or HQL delete).

So, in the end, it looks like it’s not possible to use these queries. 😥

I just wanted to delete some rows from database god damn !!! 

This problem summarizes typical compatibility issues every open source developer faces so often. I wonder whether .NET developers are free from such weird issues?

P.S. Hibernate 3 does not support SQL update/delete queries with createSQLQuery() API…why? why? why? 🙂

Finally…I used session.Connection() API to get the connection and used good old PreparedeStatement to do the work for me.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: