-->
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.  [ 2 posts ] 
Author Message
 Post subject: Limitation on (in) property in hibernate criteria
PostPosted: Wed Jun 18, 2008 1:32 am 
Newbie

Joined: Wed Jun 18, 2008 1:12 am
Posts: 3
I have used IN property in criteria restrictions. in that property, i am getting error if collection of objects exceed 2090.

what is the exact problem on this.? please help me on this.
i have checked it less than 2090 objects. it worked.

code that i am using,


objSession = HibernateUtil.getSession();
objCriteria = objSession.createCriteria(SalesPersonVO.class);
Criteria objInvoiceCriteria = objSalesPersonCommissionCriteria.createCriteria("invoice");
if(obj != null && obj.length > 0)
objInvoiceCriteria.add(Restrictions.in("invoiceId", obj));
objList = objInvoiceCriteria.list();

thanks in advance,
Jothi Nadesan


Top
 Profile  
 
 Post subject: Re: Limitation on (in) property in hibernate criteria
PostPosted: Wed Jun 18, 2008 3:06 am 
Newbie

Joined: Wed Jun 18, 2008 1:12 am
Posts: 3
Hi friends,

jothinst wrote:
I am using IN property in criteria restrictions. in that property, i am getting error if collection of objects exceed 2090.

what is the exact problem on this.? please help me on this.
i have checked it less than 2090 objects. it worked.

code that i am using,


objSession = HibernateUtil.getSession();
objCriteria = objSession.createCriteria(SalesPersonVO.class);
Criteria objInvoiceCriteria = objSalesPersonCommissionCriteria.createCriteria("invoice");
if(obj != null && obj.length > 0)
objInvoiceCriteria.add(Restrictions.in("invoiceId", obj));
objList = objInvoiceCriteria.list();

I am getting the following exception

org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2214)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
at org.hibernate.loader.Loader.list(Loader.java:2090)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:95)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:458)

Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: The statement did not return a result set.
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerStatement.doExecuteQuery(Unknown Source)
at com.microsoft.sqlserver.jdbc.SQLServerPreparedStatement.executeQuery(Unknown Source)
at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.executeQuery(NewProxyPreparedStatement.java:76)
at org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:186)
at org.hibernate.loader.Loader.getResultSet(Loader.java:1778)
at org.hibernate.loader.Loader.doQuery(Loader.java:662)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:224)
at org.hibernate.loader.Loader.doList(Loader.java:2211)

thanks in advance,
Jothi Nadesan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

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.