HHH-5220 HHH-5231 : Fix unit test failures and DB lockups for SELECT COUNT(DISTINCT arg1, arg2) tests

git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@19722 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
Gail Badner 2010-06-14 04:27:40 +00:00
parent c53359d468
commit 9e6d8be376
3 changed files with 21 additions and 6 deletions

View File

@ -135,4 +135,7 @@ public class Oracle9iDialect extends Oracle8iDialect {
return true;
}
public boolean supportsTupleDistinctCounts() {
return false;
}
}

View File

@ -164,4 +164,8 @@ public class SQLServerDialect extends AbstractTransactSQLDialect {
public boolean doesRepeatableReadCauseReadersToBlockWriters() {
return false; // here assume SQLServer2005 using snapshot isolation, which does not have this problem
}
public boolean supportsTupleDistinctCounts() {
return false;
}
}

View File

@ -4,6 +4,7 @@ package org.hibernate.test.hql;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Collections;
import java.util.List;
import junit.framework.Test;
@ -33,6 +34,12 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
SelectClause.VERSION2_SQL = true;
}
public String[] getMappings() {
return new String[] {
"hql/Animal.hbm.xml",
};
}
public boolean createSchema() {
return true; // needed for the Criteria return type test
}
@ -119,6 +126,7 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
// HHH-1724 Align Criteria with HQL aggregation return types.
public void testCriteriaAggregationReturnType() {
Session s = openSession();
s.beginTransaction();
Human human = new Human();
human.setBigIntegerValue( new BigInteger("42") );
human.setBigDecimalValue( new BigDecimal(45) );
@ -172,6 +180,7 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
s.delete( human );
s.flush();
s.getTransaction().commit();
s.close();
}
@ -224,7 +233,7 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
.setProjection( Projections.count( "nickName" ).setDistinct() )
.uniqueResult();
assertEquals( 2, count.longValue() );
s.clear();
s.close();
s = openSession();
t = s.beginTransaction();
@ -336,5 +345,4 @@ public class CriteriaHQLAlignmentTest extends QueryTranslatorTestCase {
t.commit();
s.close();
}
}