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?