in reply to Re: std dev calculations slow over time
in thread std dev calculations slow over time

brian d foy doth spake

>I see you have some commit calls in there, but
>I didn't see where you set up a transaction.

my $dbh = DBI->connect( "dbi:SQLite:$dsn", '','', { RaiseError => 1, AutoCommit => 0 } ) or die "$DBI::errstr\n";

I also used Devel::Profiler to do some investigating, but dprofpp tmon.out kept on croaking on me with

>dprofpp tmon.out Modification of non-creatable array value attempted, subscript -1 at C +:\Perl\bin/dprofpp.bat line 717, <fh> line 1250.

so I gave up that route because I really didn't know wtf that was all about.

--

when small people start casting long shadows, it is time to go to bed

Replies are listed 'Best First'.
Re^3: std dev calculations slow over time
by AK108 (Friar) on Oct 22, 2006 at 21:25 UTC
    Transactions (in any database support by DBI) are handled with the $dbh->begin_work and $dbh->commit methods. See the "transactions" section of DBI.pm.
Re^3: std dev calculations slow over time
by randyk (Parson) on Oct 22, 2006 at 23:09 UTC
    my $dbh = DBI->connect( "dbi:SQLite:$dsn", '','',
    { RaiseError => 1, AutoCommit => 0 } )
    or die "$DBI::errstr\n";
    I found with Win32 ActivePerl that explicitly setting $dbh->{AutoCommit} = 0; here helps.