-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate prepared statement issues
PostPosted: Mon Aug 06, 2012 12:32 pm 
Newbie

Joined: Mon Aug 06, 2012 12:25 pm
Posts: 1
We are using Hibernate 3 with WebSphere v6 and DB2. We are having strange issue with wrong SQL prepared statements issued by Hibernate and causing syntax issues.

Good query issued by Hibernate:

select * from rocc.Transaction t where t.status_cd = 0 and t.application_cd = ? order by coalesce(t.priority,0) fetch first 25 rows only

Same query issued by Hibernate incorrectly sometimes:

SELECT * FROM rocc.Transaction t WHERE t.status_cd = ? AND t.application_cd = ? ORDER BY COALESCE(t.priority,?) FETCH first ? ROWS ONLY

It is replacing values(zero) with question mark and changing font of the keywords to uppercase (it does not matter, but mentioning here). It also changed the number 25 in fetch clause with question mark.

What is causing with the wrong prepared statement issued by Hibernate sometimes?

Hibernate is calling WSJdbcPreparedStament.executeQuery method.

Thanks,
Venkat


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.