db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Husek, Paul" <Paul.Hu...@pfizer.com>
Subject Back to back save is slow
Date Fri, 15 Oct 2004 16:58:55 GMT
Hello fellow Torquers,


I like how Torque allows you to retrieve a list of Torque objects with a
single select.  That's great!  I'm looking for something similar for save()


I'm doing some profiling on my application and see that a lot of time is
being used in the part of code where I save about 1000  Torque objects back
to the database; they are all the same type.  Right now the code is
essentially a for loop doing a save() on each object.   I'm wondering if
there is a way to speed this up, by effectively passing an array of objects
to be saved in a single method and allowing the Torque engine to only do a
single prepare.


Instead of 

for (int i=0;i<books.length;i++) {

   Book book=(Book)books[i];




The save method is taking up the vast majority of the time in this loop of


Maybe something like BookPeer.save(books);


Is there any method like this or any easy way to accomplish what I'm looking


Thanks much!





  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message