-->
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.  [ 1 post ] 
Author Message
 Post subject: Query.list() throws exception
PostPosted: Tue Nov 21, 2006 4:14 pm 
Newbie

Joined: Tue Nov 21, 2006 2:53 pm
Posts: 2
Location: St. Louis
Hi,

I really need help to resolve this problem because I already did a lot of search but got no answer on this. My project is a J2EE application which use JBoss, Hibernate and SQL Server 2000. I'm a hibernate beginner. My project works fine when accessing MySQL server. But after I switch to the SQL Server. I got following exception:


13:12:07,320 WARN [JDBCExceptionReporter] SQL Error: 0, SQLState: null
13:12:07,320 ERROR [JDBCExceptionReporter] The requested operation is not supported on forward only result sets.
13:12:07,320 INFO [STDOUT] org.hibernate.exception.GenericJDBCException: could not execute query
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:1564)
at org.hibernate.loader.Loader.list(Loader.java:1544)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:271)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:830)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
at com.wellsfargo.fedata.dao.AssumptionDao.getOwnedAssumptionList(AssumptionDao.java:284)



My code is very simple:
Code:
            lSession = openSession();
            lTx = lSession.beginTransaction();
            Query lQuery = lSession.createQuery("from AssumptionListItem as m where m.userId = :userId order by m.id" );
            lQuery.setString("userId", aUserId);
            lQuery.setMaxResults(aPageSize);
            lQuery.setFirstResult(aPageSize * aPageNumber);
            lItems = lQuery.list();


Since my project works fine with MySQL, I'm guessing this must be related to some special configuration in Hibernate in order to access SQL Server configuration.

Thank you very much for the help!

Leon


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

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.