Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version: 3.1
Mapping documents:
Code:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Aug 25, 2006 2:44:36 PM by Hibernate Tools 3.2.0.beta7 -->
<hibernate-mapping>
<class name="com.parago.dao.ImCode" table="IM_CODE" schema="IM" lazy="true">
<id name="codeid" type="long">
<column name="CODEID" precision="22" scale="0" />
<generator class="increment" />
</id>
<property name="updatedate" type="calendar" insert="true" update="true">
<column name="UPDATE_DATE" />
</property>
<property name="insertdate" type="calendar" insert="true" update="false">
<column name="INSERT_DATE" />
</property>
<property name="gameid" type="long">
<column name="GAMEID" precision="22" scale="0" />
</property>
<property name="code" type="string">
<column name="CODE" length="25" unique="true" />
</property>
<property name="redeemflag" type="boolean">
<column name="REDEEMFLAG" />
</property>
<property name="usedflag" type="boolean">
<column name="USEDFLAG" />
</property>
<property name="playerid" type="long">
<column name="PLAYERID" precision="22" scale="0" />
</property>
<property name="batchid" type="long">
<column name="BATCHID" precision="22" scale="0" />
</property>
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close(): N/A
Full stack trace of any exception that occurs:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
Name and version of the database you are using: Oracle 9i
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
I am trying to randomly access elements in a very large ScrollableResult Set (approx 12million records). I get the ScrollableResults, generate a random number in my set size, and try to setRowNumber(rndnum). It throws the OutOfMemory error the first time. I have use_scrollable_resultset set to true.
As a test, I tried to call results.last(), and it threw the same error.
From my reading of the forum search results and the documentation, I can see how I could get this error if I don't flush the session periodically while operating on the set elements, but this error is occurring the first time I try to touch the results. I thought this was the correct way to access a result set without eagerly fetching the entire set.
What obvious simple piece of information am I missing?