-->
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: fetch data partially
PostPosted: Mon Jul 14, 2008 6:59 am 
Beginner
Beginner

Joined: Thu Jun 14, 2007 4:33 am
Posts: 39
Hi,

Hibernate:
8.2.6.ga
Database:
postgres and oracle


I have to read data from the oracle-database (legacy), do some stuff with the data and then insert it into the postgres-database.

however there is a lot of data (over a million rows with over 20 columns) and i dont want to hold all of the data in memory.

how can i partially read data from the oracle-database (e.g. 1000 rows each iteration)?
does the query-iterator fetch each row separately or does it load the whole data into memory and then iterate over it?

i dont want to do something like
select * where id between 1000 and 2000
because the ids are not really consecutively, there migth be only one row between id 101.000 and 102.000..

//ecit
is pagination the right answer?
like discussed here: http://forum.springframework.org/showthread.php?t=9658


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 14, 2008 10:18 am 
Expert
Expert

Joined: Tue May 13, 2008 3:42 pm
Posts: 919
Location: Toronto & Ajax Ontario www.hibernatemadeeasy.com
Somtimes, when you're deaing with such a large number of rows, hibernate isn't necessarily the answer.

Perhaps, in a case like this, you might want to consider ETL tools like DataStage or something along those lines?

_________________
Cameron McKenzie - Author of "Hibernate Made Easy" and "What is WebSphere?"
http://www.TheBookOnHibernate.com Check out my 'easy to follow' Hibernate & JPA Tutorials


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.