|
From: Keith D. <kd...@cs...> - 2004-04-26 20:16:53
|
I think a SqlUpdate operation that can perform batch inserts would be a nice addition to the jdbc.object package. I'd like to be able to set the batch size, and then just call "batchInserter.insert(object)" and have the SqlUpdate.update(Object[] Parameters) method automatically queue up sql operations until the batch size is reached, and then commit 'em all, starting over for the next batch.... (likely requiring a flush() call once there is no more data.) I'm essentially doing large data loads. Is there something like this already? If not, I can write it. I could use it! Keith |
|
From: Rod J. <rod...@in...> - 2004-04-26 20:51:03
|
I've written something like this for a client (last week in fact!) but hadn't thought of contributing it. Good point. Mine is a JavaBean that uses a JdbcTemplate and holds the page in an ArrayList. I'll have a look tomorrow and see if I can make it generic enough. Rgds, Rod ----- Original Message ----- From: "Keith Donald" <kd...@cs...> To: <spr...@li...> Sent: Monday, April 26, 2004 9:16 PM Subject: [Springframework-developer] Schema batch update operation > I think a SqlUpdate operation that can perform batch inserts would be a nice > addition to the jdbc.object package. I'd like to be able to set the batch > size, and then just call "batchInserter.insert(object)" and have the > SqlUpdate.update(Object[] Parameters) method automatically queue up sql > operations until the batch size is reached, and then commit 'em all, > starting over for the next batch.... (likely requiring a flush() call once > there is no more data.) > > I'm essentially doing large data loads. Is there something like this > already? If not, I can write it. I could use it! > > Keith > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: <tho...@tr...> - 2004-04-26 21:04:06
|
Keith, There is a batchUpdate() method on the JdbcTemplate that could be used. Maybe we could have an SqlBatchUpdate() class that extends or mimics SqlUpdate and uses batchUpdate() for the update calls to JdbcTemplate. Thomas Quoting Keith Donald <kd...@cs...>: > I think a SqlUpdate operation that can perform batch inserts would be a nice > addition to the jdbc.object package. I'd like to be able to set the batch > size, and then just call "batchInserter.insert(object)" and have the > SqlUpdate.update(Object[] Parameters) method automatically queue up sql > operations until the batch size is reached, and then commit 'em all, > starting over for the next batch.... (likely requiring a flush() call once > there is no more data.) > > I'm essentially doing large data loads. Is there something like this > already? If not, I can write it. I could use it! > > Keith > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Keith D. <kd...@cs...> - 2004-04-27 00:19:41
|
I went ahead and committed an initial stab at this support to the sandbox... the classes are in the sandbox at: org.springframework.jdbc.object.BatchSqlUpdate org.springframework.jdbc.object.SimplePreparedStatementSetter Client usage is exacly like SqlUpdate, there is just an addition of a setBatchSize method (the default of 100 I just picked out of the air...) The 'SimplePreparedStatementSetter' class is used by BatchSqlUpdate to simplify it's code. It's basically just a strategy refactoring from PreparedStatementFactory to allow the setting of parameter values against the same prepared statement. Keith -----Original Message----- From: spr...@li... [mailto:spr...@li...] On Behalf Of tho...@tr... Sent: Monday, April 26, 2004 5:04 PM To: spr...@li... Subject: Re: [Springframework-developer] Schema batch update operation Keith, There is a batchUpdate() method on the JdbcTemplate that could be used. Maybe we could have an SqlBatchUpdate() class that extends or mimics SqlUpdate and uses batchUpdate() for the update calls to JdbcTemplate. Thomas Quoting Keith Donald <kd...@cs...>: > I think a SqlUpdate operation that can perform batch inserts would be > a nice addition to the jdbc.object package. I'd like to be able to > set the batch size, and then just call "batchInserter.insert(object)" > and have the SqlUpdate.update(Object[] Parameters) method > automatically queue up sql operations until the batch size is reached, > and then commit 'em all, starting over for the next batch.... (likely > requiring a flush() call once there is no more data.) > > I'm essentially doing large data loads. Is there something like this > already? If not, I can write it. I could use it! > > Keith > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > ------------------------------------------------------- This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek For a limited time only, get FREE Ground shipping on all orders of $35 or more. Hurry up and shop folks, this offer expires April 30th! http://www.thinkgeek.com/freeshipping/?cpg=12297 _______________________________________________ Springframework-developer mailing list Spr...@li... https://lists.sourceforge.net/lists/listinfo/springframework-developer |
|
From: Rod J. <rod...@in...> - 2004-04-27 06:26:34
|
Mine uses JdbcTemplate.batchUpdate(), and the performance is brilliant. Mind you the optimal batch size for what I need to do is 5,000. ----- Original Message ----- From: <tho...@tr...> To: <spr...@li...> Sent: Monday, April 26, 2004 10:04 PM Subject: Re: [Springframework-developer] Schema batch update operation > Keith, > > There is a batchUpdate() method on the JdbcTemplate that could be used. Maybe > we could have an SqlBatchUpdate() class that extends or mimics SqlUpdate and > uses batchUpdate() for the update calls to JdbcTemplate. > > Thomas > > > Quoting Keith Donald <kd...@cs...>: > > > I think a SqlUpdate operation that can perform batch inserts would be a nice > > addition to the jdbc.object package. I'd like to be able to set the batch > > size, and then just call "batchInserter.insert(object)" and have the > > SqlUpdate.update(Object[] Parameters) method automatically queue up sql > > operations until the batch size is reached, and then commit 'em all, > > starting over for the next batch.... (likely requiring a flush() call once > > there is no more data.) > > > > I'm essentially doing large data loads. Is there something like this > > already? If not, I can write it. I could use it! > > > > Keith > > > > > > > > > > > > ------------------------------------------------------- > > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > > For a limited time only, get FREE Ground shipping on all orders of $35 > > or more. Hurry up and shop folks, this offer expires April 30th! > > http://www.thinkgeek.com/freeshipping/?cpg=12297 > > _______________________________________________ > > Springframework-developer mailing list > > Spr...@li... > > https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > > > > ------------------------------------------------------- > This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek > For a limited time only, get FREE Ground shipping on all orders of $35 > or more. Hurry up and shop folks, this offer expires April 30th! > http://www.thinkgeek.com/freeshipping/?cpg=12297 > _______________________________________________ > Springframework-developer mailing list > Spr...@li... > https://lists.sourceforge.net/lists/listinfo/springframework-developer > |
|
From: Thomas R. <tho...@tr...> - 2004-04-27 10:26:53
|
Using batch updates on Oracle usually provides a drastic performance improvement. Don't know if the same is true for other databases. I'll take a look at Keith's class in the sandbox later on this week. Thomas Rod Johnson wrote: >Mine uses JdbcTemplate.batchUpdate(), and the performance is brilliant. Mind >you the optimal batch size for what I need to do is 5,000. > >----- Original Message ----- >From: <tho...@tr...> >To: <spr...@li...> >Sent: Monday, April 26, 2004 10:04 PM >Subject: Re: [Springframework-developer] Schema batch update operation > > > > >>Keith, >> >>There is a batchUpdate() method on the JdbcTemplate that could be used. >> >> >Maybe > > >>we could have an SqlBatchUpdate() class that extends or mimics SqlUpdate >> >> >and > > >>uses batchUpdate() for the update calls to JdbcTemplate. >> >>Thomas >> >> >>Quoting Keith Donald <kd...@cs...>: >> >> >> >>>I think a SqlUpdate operation that can perform batch inserts would be a >>> >>> >nice > > >>>addition to the jdbc.object package. I'd like to be able to set the >>> >>> >batch > > >>>size, and then just call "batchInserter.insert(object)" and have the >>>SqlUpdate.update(Object[] Parameters) method automatically queue up sql >>>operations until the batch size is reached, and then commit 'em all, >>>starting over for the next batch.... (likely requiring a flush() call >>> >>> >once > > >>>there is no more data.) >>> >>>I'm essentially doing large data loads. Is there something like this >>>already? If not, I can write it. I could use it! >>> >>>Keith >>> >>> >>> >>> >>> >>>------------------------------------------------------- >>>This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>>For a limited time only, get FREE Ground shipping on all orders of $35 >>>or more. Hurry up and shop folks, this offer expires April 30th! >>>http://www.thinkgeek.com/freeshipping/?cpg=12297 >>>_______________________________________________ >>>Springframework-developer mailing list >>>Spr...@li... >>>https://lists.sourceforge.net/lists/listinfo/springframework-developer >>> >>> >>> >> >> >> >>------------------------------------------------------- >>This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >>For a limited time only, get FREE Ground shipping on all orders of $35 >>or more. Hurry up and shop folks, this offer expires April 30th! >>http://www.thinkgeek.com/freeshipping/?cpg=12297 >>_______________________________________________ >>Springframework-developer mailing list >>Spr...@li... >>https://lists.sourceforge.net/lists/listinfo/springframework-developer >> >> >> > > > > >------------------------------------------------------- >This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek >For a limited time only, get FREE Ground shipping on all orders of $35 >or more. Hurry up and shop folks, this offer expires April 30th! >http://www.thinkgeek.com/freeshipping/?cpg=12297 >_______________________________________________ >Springframework-developer mailing list >Spr...@li... >https://lists.sourceforge.net/lists/listinfo/springframework-developer > > > > > |