[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2945?page=c...
]
Thom Hehl commented on HHH-2945:
--------------------------------
Here is the source causing the issue. As you can see, I'm running this through the
Spring 2.0.7 templates.
public long countByDeferDateAndDivision(Calendar deferDate, String division) {
long result;
try {
Query query = getSession().createQuery(
"SELECT count(*) FROM PoolInfo p WHERE p.dateDeferred=? AND
p.divisionCode=?");
query.setCalendar(0, deferDate);
query.setString(1, division);
result = (Long)query.uniqueResult();
}
catch (HibernateException ex) {
throw convertHibernateAccessException(ex);
}
return result;
}
SELECT COUNT(*) fails on Linux but not on Windows XP
----------------------------------------------------
Key: HHH-2945
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-2945
Project: Hibernate3
Issue Type: Bug
Components: core
Affects Versions: 3.2.5
Environment: Windows XP/Redhat Linux
Reporter: Thom Hehl
While working with an Informix database hosting on Linux, I tested my web application
running on my windows XP workstation with the following query genereated by hibernate:
(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'
When I run this against my database, it returns the proper number every single time.
I moved my web application to our Redhat Linux environment (platform for client) and ran
the application and this same query against the same database returns 0 every single
time.
When I run the same query from SQuirreL on the Redhat Linux box using the same JDBC
driver as the webapp uses, it returns the proper values. To me, this points to hibernate
as the issue.
Here is the debugs:
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)
Thanks.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira