-->
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.  [ 3 posts ] 
Author Message
 Post subject: Alternative to session.save()
PostPosted: Mon May 02, 2005 12:17 am 
Newbie

Joined: Sat Sep 18, 2004 1:36 am
Posts: 12
Hibernate version: 2.1.18

Hello... I have a quick question regarding session.save() method in Hibernate.
Is there any alternative to session.save() that is able to insert a collection of objects? e.g. passing an ArrayList to a method that behaves the same as session.save();
After doing some profiling on my code, it turns out that the longest time spent is on communication with the database (MySQL), in particular, session.save() call.
I'm sorry for asking this silly question (hopefully it's not :) )


Regards,

Alex.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 3:30 am 
Regular
Regular

Joined: Tue Oct 26, 2004 3:54 pm
Posts: 60
I don't think such a method exists, but it is trivial to implement it in your code. Anyway, the method you ask for wouldn't do nothing different than doing multiple INSERTs in a single transaction.

If you're talking about inserting a large collection of objects there's a lot of discussion about optimizing performance across the forums.

Look at this for a start.

http://blog.hibernate.org/cgi-bin/blosx ... 8/26#batch


Regards,

Giulio


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 02, 2005 6:40 am 
Newbie

Joined: Sat Sep 18, 2004 1:36 am
Posts: 12
i have read that article before..
just wondering if there are any other alternatives....
anyway, thanks a lot for the suggestion :)

regards,

Alex.


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