IntelliJ open source
[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Performance
 
RSS feed
 
New topic
Author

Keeping 4 lakhs db records data into a array list of plain java bean or VO objects

venkata vinay bysani
Greenhorn

Joined: Feb 09, 2010
Messages: 1

Dear Friends,

Is it a good way to keep all 4 lakhs records from db into a array list. Will it affects the performance. My requirement is i need to migrate that data to a content repository. So i need to send them one by one by accessing those plain java bean or VO's present in the array list.

Please let me know what is the efficeint way, whether to read 1000 records once process them and then again read another 1000 or i can do all 4 lakhs at a time. Which way will me more performance oriented.

Please help me ASAP Thanks in advance.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Messages: 4870

Read them X records at a time and process them. 400,000 records processed into an arraylist can become bulky and inefficient. Trying to gulp down all the data at once is usually not the way to go

SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Nitesh Kant
Bartender

Joined: Feb 25, 2007
Messages: 1478

venkata vinay bysani wrote:Which way will me more performance oriented.


Performance is very subjective. It depends on what kind of processing you are doing.
If you have to iterate over the list processing each record one by one and you do not have memory constraints then nothing like keeping it simple.
However, if you have to search elements in the list and massage data then obviously a list with half a million records is an absolute no.

Quest for getting the right answers start with asking the right questions.
How to ask questions on javaranch.
Yosi Hendarsjah
Ranch Hand

Joined: Oct 02, 2003
Messages: 161

venkata vinay bysani wrote:
Is it a good way to keep all 4 lakhs records

Please use English words. Not all the members of this forum know what lakh is.
 
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Java » Performance
 
RSS feed
 
New topic
hibernate profiler