-->
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.  [ 4 posts ] 
Author Message
 Post subject: Use of Hibernate to insert million records from Flat File
PostPosted: Sat Oct 28, 2006 8:25 am 
Newbie

Joined: Wed Sep 06, 2006 7:34 pm
Posts: 3
Hi I am new to Hibernate and have secenario where I have to read a flat file parse it and insert into database. Now the flat file is pretty big that is may contain arround million records. It's taking too long to insert all the records if going through the traditional way so wondering if using hibernate how can I make it faster. But I am not that much familiar with hibernate so wondering if soomeone can help me out here I have used hibernate for simple stuff so far. Can someone provide a small sample or tutorial on this on reading a file and inserting the records into database. Any help is appreciated.

Thanks



Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 3:12 am 
Senior
Senior

Joined: Sun Jun 11, 2006 10:41 am
Posts: 164
What do you mean by "too long in the traditional way"? Please post the code you used to do the inserts and its performance figures.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 29, 2006 11:43 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Hibernate is not the best tools to do this with. Not saying it cannot be done just not the best. Databases in most cases supply very good fast native loaders. Why don't you use the tools that are supplied with the database? Alternatively, for a more permanent loading situation I would have a look at dbUnit.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 30, 2006 1:34 am 
Senior
Senior

Joined: Sun Jun 04, 2006 1:58 am
Posts: 136
In a word ...dont do it .... i d use the "traditional" PS to do that kind of stuff unless you are very fond of OutofMem Kind of exceptions ..

_________________
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.