1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

DBD-SQLite: added a comment to the busy test, and made the first timeout happen sooner

This commit is contained in:
Kenichi Ishigaki 2009-08-15 09:34:12 +00:00
parent c944fdc5e4
commit 411cd59e82

View file

@ -30,7 +30,14 @@ foreach my $call_func (@CALL_FUNCS) {
AutoCommit => 0, AutoCommit => 0,
); );
ok($dbh2->$call_func(3000, 'busy_timeout')); # NOTE: Let's make it clear what we're doing here.
# $dbh starts locking with the first INSERT statement.
# $dbh2 tries to INSERT, but as the database is locked,
# it starts waiting. However, $dbh won't release the lock.
# Eventually $dbh2 gets timed out, and spits an error, saying
# the database is locked. So, we don't need to let $dbh2 wait
# too much here. It should be timed out anyway.
ok($dbh2->$call_func(300, 'busy_timeout'));
ok($dbh->do("CREATE TABLE Blah ( id INTEGER, val VARCHAR )")); ok($dbh->do("CREATE TABLE Blah ( id INTEGER, val VARCHAR )"));
ok($dbh->commit); ok($dbh->commit);