how to execute 30 transactions at a time

Discussion in 'Perl Misc' started by alwaysonnet, Nov 20, 2006.

  1. alwaysonnet

    alwaysonnet Guest

    hi all,

    I've a limitation with my database that it wont accept more than 30
    queries at a time. i'm passing the queries as an array. if the length
    of array is more than 30 , then execution is getting failed.

    how can i implement so that every-time only 30 queries will be loaded
    and rest will be loaded after their execution.

    I believe we can just fix the length of array everytime ....but my mind
    got numb thinking...

    Thanks,
    Raj
     
    alwaysonnet, Nov 20, 2006
    #1
    1. Advertising

  2. alwaysonnet wrote:
    > I've a limitation with my database that it wont accept more than 30
    > queries at a time. i'm passing the queries as an array. if the length
    > of array is more than 30 , then execution is getting failed.
    >
    > how can i implement so that every-time only 30 queries will be loaded
    > and rest will be loaded after their execution.


    while ( my @part = splice @arr, 0, 30 ) {
    querydb( @part );
    }

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 20, 2006
    #2
    1. Advertising

  3. alwaysonnet

    Craig Guest

    > while ( my @part = splice @arr, 0, 30 ) { querydb( @part ); }

    Wouldn't that load 31, not 30? :)
     
    Craig, Nov 21, 2006
    #3
  4. Craig wrote:
    > Gunnar Hjalmarsson wrote:
    >> alwaysonnet wrote:
    >>> how can i implement so that every-time only 30 queries will be loaded
    >>> and rest will be loaded after their execution.

    >>
    >> while ( my @part = splice @arr, 0, 30 ) {
    >> querydb( @part );
    >> }

    >
    > Wouldn't that load 31, not 30? :)


    No.

    perldoc -f splice

    --
    Gunnar Hjalmarsson
    Email: http://www.gunnar.cc/cgi-bin/contact.pl
     
    Gunnar Hjalmarsson, Nov 21, 2006
    #4
  5. Craig wrote:
    >> while ( my @part = splice @arr, 0, 30 ) { querydb( @part ); }

    >
    > Wouldn't that load 31, not 30? :)


    $ perl -le'my @arr = 1 .. 99; my @part = splice @arr, 0, 30; print "@part"'
    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30



    John
    --
    Perl isn't a toolbox, but a small machine shop where you can special-order
    certain sorts of tools at low cost and in short order. -- Larry Wall
     
    John W. Krahn, Nov 21, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arthur Dent
    Replies:
    1
    Views:
    1,091
    Jim Gibson
    Dec 3, 2003
  2. psb
    Replies:
    0
    Views:
    1,686
  3. martin

    Transactions

    martin, Dec 11, 2003, in forum: ASP .Net
    Replies:
    2
    Views:
    402
    Jeff Siver
    Dec 11, 2003
  4. flamesrock
    Replies:
    8
    Views:
    553
    Hendrik van Rooyen
    Nov 24, 2006
  5. Savas Ates
    Replies:
    1
    Views:
    307
    Patrice
    Aug 17, 2004
Loading...

Share This Page