-->
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: Bulk Insert by using hibernate
PostPosted: Wed Oct 15, 2003 11:29 am 
Beginner
Beginner

Joined: Wed Sep 10, 2003 5:32 pm
Posts: 28
Hi everyone,

Can someone give me some good suggestions on how to perform an efficient bulk insert by using hibernate?? I don't want to use straight SQL because my application will support multiple database and I don't want to create individual SQL for each platform plus the bulk insert statement changes according to user request. What is the best way to do an efficient bulk insert by using Hibernate to simulate something like the following SQL statement without using static SQL:

INSERT INTO TABLE_1(VALUE1, VALUE2, VALUE3) SELECT
TABLE_2.VALUE1, TABLE_2.VALUE2, TABLE_3.VALUE3 FROM TABLE_2, TABLE_3
WHERE TABLE2.ID = TABLE_3.ID AND TABLE_2.VALUE4 = 'SOMETHING'. AND TABLE_3.VALUE5 = 'SOMETHING'

This is just an example SQL and the application uses different SELECT statement in the bulk insert.

Thanks

Vivian


Top
 Profile  
 
 Post subject: Re: Bulk Insert by using hibernate
PostPosted: Sun Jan 11, 2015 4:38 pm 
Newbie

Joined: Sun Jan 11, 2015 4:28 pm
Posts: 5
Hi vfronger,

Hibernate can execute batched inserts with acceptable performance, when used right. It can use JDBC batches but the generated SQL depends on the driver at the end.
Check this posts which explain exactly what you need:

http://korhner.github.io/hibernate/hibernate-performance-traps-part-1/
http://korhner.github.io/hibernate/hibernate-performance-traps-part-2/


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.