At the app level you can do something like this to check for the
"database is locked(5)" error. Note the sleep and max ~1000 attempts
functionality as well.

my $ct = 0;
while( $ct++ < 1000 ){
  $dbh->do($sql, {}, @bind);
  if( $dbh->err == 5 ){  # If got a locked code, try again
    sleep 1;
    next;
  }
  ...
}


On Mon, Mar 16, 2009 at 7:05 AM, marcos rebelo <[email protected]> wrote:
> Hi all
>
> I'm a Perl programmer using SQLite
>
> I want to retry to execute every command automatically, until the DB
> is not locked. In C seems that I need to set the busy_handler.
>
> How do I do this with DBD in Perl?
>
> Thanks for any help
>
> Best Regards
> Marcos Rebelo
>
> --
> Marcos Rebelo
> http://oleber.freehostia.com
> Milan Perl Mongers leader http://milan.pm.org
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to