-->
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: Msg exception: scrollable result sets not enabled
PostPosted: Thu Apr 01, 2010 5:15 pm 
Newbie

Joined: Thu Apr 01, 2010 5:13 pm
Posts: 2
I am using hibernate with oracle and got the following code snippet:

ScrollableResults results = criteria.scroll(ScrollMode.SCROLL_SENSITIVE);

When I run the above snippet I get the following exception:

org.hibernate.AssertionFailure: scrollable result sets are not enabled

I'm using hibernate 3.2.2.ga and oracle 10g

Can someone help me? How can I solve this problem?

Victor Lindberg


Top
 Profile  
 
 Post subject: Re: Msg exception: scrollable result sets not enabled
PostPosted: Fri Apr 02, 2010 2:45 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
It depends on your jdbc-driver (and the database behind) if scrollable result sets are supported or not.

To determinate this hibernate does following (this is a summary):
Code:
Class.forName("oracle.jdbc.driver.OracleDriver");
java.sql.Connection connection = java.sql.DriverManager.getConnection(yourUrl ,userName,password);
boolean ScrollableResultSetsEnabled = connection.getMetaData().supportsResultSetType( java.sql.ResultSet.TYPE_SCROLL_INSENSITIVE );
...
if (...  !factory.getSettings().isScrollableResultSetsEnabled())
   throw new AssertionFailure("scrollable result sets are not enabled");


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.