HHH-2166 - Long 'in' lists in queries results in a Java stack overflow exception.
git-svn-id: https://svn.jboss.org/repos/hibernate/core/trunk@18366 1b8cb986-b30d-0410-93ca-fae66ebed9b2
This commit is contained in:
parent
95e10ad81d
commit
7fb4558c1d
|
@ -32,7 +32,6 @@ import org.hibernate.Query;
|
|||
import org.hibernate.Session;
|
||||
import org.hibernate.Transaction;
|
||||
import org.hibernate.criterion.Restrictions;
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.dialect.Oracle8iDialect;
|
||||
import org.hibernate.dialect.SQLServerDialect;
|
||||
import org.hibernate.junit.functional.FunctionalTestCase;
|
||||
|
@ -40,8 +39,9 @@ import org.hibernate.test.hql.StateProvince;
|
|||
|
||||
/**
|
||||
*
|
||||
* HHH-2166 Long "in" lists in queries results in a Java stack overflow exception.
|
||||
* to reproduce this issue, you should add "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
|
||||
* HHH-2166 Long "in" lists in queries results in a Java stack overflow
|
||||
* exception. to reproduce this issue, you should add
|
||||
* "<argLine>-Xss128k</argLine>" to the surefire plugin (test on Fedora 12)
|
||||
*
|
||||
* @author Strong Liu
|
||||
*/
|
||||
|
@ -59,6 +59,10 @@ public class LongInElementsTest extends FunctionalTestCase {
|
|||
|
||||
// HHH-2166
|
||||
public void testLongInElementsByHQL() {
|
||||
if ( (getDialect() instanceof SQLServerDialect)
|
||||
|| (getDialect() instanceof Oracle8iDialect) ){
|
||||
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
|
||||
}
|
||||
Session session = openSession();
|
||||
Transaction t = session.beginTransaction();
|
||||
|
||||
|
@ -69,7 +73,8 @@ public class LongInElementsTest extends FunctionalTestCase {
|
|||
session.flush();
|
||||
session.clear();
|
||||
|
||||
Query query = session.createQuery("from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )");
|
||||
Query query = session
|
||||
.createQuery( "from org.hibernate.test.hql.StateProvince sp where sp.id in ( :idList )" );
|
||||
query.setParameterList( "idList" , createLotsOfElements() );
|
||||
List list = query.list();
|
||||
session.flush();
|
||||
|
@ -83,6 +88,10 @@ public class LongInElementsTest extends FunctionalTestCase {
|
|||
|
||||
// HHH-2166
|
||||
public void testLongInElementsByCriteria() {
|
||||
if ( (getDialect() instanceof SQLServerDialect)
|
||||
|| (getDialect() instanceof Oracle8iDialect) ){
|
||||
skipExpectedFailure( new Exception("this test fails on oracle and ms sql server, for more info, see HHH-1123") );
|
||||
}
|
||||
Session session = openSession();
|
||||
Transaction t = session.beginTransaction();
|
||||
|
||||
|
@ -105,12 +114,6 @@ public class LongInElementsTest extends FunctionalTestCase {
|
|||
|
||||
}
|
||||
|
||||
public boolean appliesTo( Dialect dialect ) {
|
||||
//HHH-1123
|
||||
return !(dialect instanceof SQLServerDialect) && !(dialect instanceof Oracle8iDialect);
|
||||
|
||||
}
|
||||
|
||||
private List createLotsOfElements() {
|
||||
List list = new ArrayList();
|
||||
for ( int i = 0; i < ELEMENTS_SIZE; i++ ) {
|
||||
|
|
Loading…
Reference in New Issue