-->
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: SELECT COUNT(*) fails on Linux but not on Windows XP
PostPosted: Fri Nov 09, 2007 2:44 pm 
Newbie

Joined: Wed Oct 04, 2006 2:43 pm
Posts: 16
Location: Lexington, KY
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

3.x--Whatever ships with Spring 2.0.7

Name and version of the database you are using:

Informix IDS 9.x

The generated SQL (show_sql=true):

(From P6 spy)
select count(*) as col_0_0_ from POOL poolinfo0_ where poolinfo0_.DEF_DATE='2008-02-11 00:00:00.0' and poolinfo0_.DIVISION_CODE='3'

Debug level Hibernate log excerpt:
64854 DEBUG org.hibernate.jdbc.ConnectionManager | opening JDBC connection
64854 DEBUG org.hibernate.SQL | select count(*) as col_0_0_ from POOL poolinfo0_ where poolinfo0_.DEF_DATE=? and poolinfo0_.DIVISION_CODE=?
Hibernate: select count(*) as col_0_0_ from POOL poolinfo0_ where poolinfo0_.DEF_DATE=? and poolinfo0_.DIVISION_CODE=?
64854 DEBUG org.hibernate.jdbc.AbstractBatcher | preparing statement
64856 DEBUG org.hibernate.type.CalendarType | binding '2008-02-11 00:00:00' to parameter: 1
64856 DEBUG org.hibernate.type.StringType | binding '3' to parameter: 2
64899 DEBUG org.hibernate.jdbc.AbstractBatcher | about to open ResultSet (open ResultSets: 0, globally: 0)
64899 DEBUG org.hibernate.loader.Loader | processing result set
64899 DEBUG org.hibernate.loader.Loader | result set row: 0
64899 DEBUG org.hibernate.loader.Loader | result row:
64899 DEBUG org.hibernate.type.LongType | returning '0' as column: col_0_0_
64899 DEBUG org.hibernate.loader.Loader | done processing result set (1 rows)
64899 DEBUG org.hibernate.jdbc.AbstractBatcher | about to close ResultSet (open ResultSets: 1, globally: 1)
64899 DEBUG org.hibernate.jdbc.AbstractBatcher | about to close PreparedStatement (open PreparedStatements: 1, globally: 1)


Problems with Session and transaction handling?

When I run the above query through Spring with tomcat running on Windows XP, the query returns the count just as it should. When I run the query on a Redhat Linux box, it always returns 0.

I turned on P6Spy on the Linux server and captured the query being run by hibernate and it works find in Squirrel. This points to a bug in Hibernate.

Ideas?


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.