-->
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: ClassCastException in method next() of ScrollableResults
PostPosted: Tue Dec 28, 2004 8:23 am 
Newbie

Joined: Fri Apr 16, 2004 3:56 am
Posts: 4
Hibernate version:2.1.7

Mapping documents:

Code between sessionFactory.openSession() and session.close():
Code:
try{
            Session hibSess = ks.getHibernateSession();
         
         Query query = hibSess.createQuery(strBuffQuery.toString());   
         
         if(log4j.isDebugEnabled()){
             log4j.debug("Query: "+strBuffQuery);
         }
         
         
         ScrollableResults rs = query.scroll();
         
         Object [] objRow = null;
         while(rs.next()){
            objRow = rs.get();
            alResult.add(objRow);            
         }
         } catch (HibernateException he){         
            throw new KevusPersistenzException(he);
         }


stackTrace="java.lang.ClassCastException at net.sf.hibernate.impl.ScrollableResultsImpl.prepareCurrentRow(ScrollableResultsImpl.java:422) at net.sf.hibernate.impl.ScrollableResultsImpl.next(ScrollableResultsImpl.java:95)

Name and version of the database you are using:mckoi 1.0

The generated SQL (show_sql=true):Hibernate: select angebot0_.PDF as x0_0_ from ANGEBOT angebot0_ left outer join INTERESSENT interessen1_ on angebot0_.PER_ANG_OID=interessen1_.OID left outer join PERSON interessen1__1_ on interessen1_.OID=interessen1__1_.OID left outer join ADRESSE adresseset2_ on interessen1_.OID=adresseset2_.PER_OID where (angebot0_.MANDANTID=8000000001013 )and(((lower(angebot0_.OID)like cast(lower('8a8194ae01192dce0101192f7c890004')as string collate 'deDE'))or(lower(angebot0_.OID)like cast(lower('8a8194ae01192dce0101192f7c890004')as string collate 'deDE'))))


Debug level Hibernate log excerpt: error

Code worked with former implementation from hibernate2.jar (Version 2.1.2) . What has changed?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 28, 2004 8:52 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
looking at the code

Code:
if (result != null && result.getClass().isArray()) {
            currentRow = (Object[]) result;
         }


then i would say that line cannot throw that exception....try to use a debugger to see what goes on.

_________________
Max
Don't forget to rate


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.