[Dbi-interbase-devel] bug in tpb ?
Status: Beta
Brought to you by:
edpratomo
From: Pavel Z. <pa...@tv...> - 2001-12-25 11:55:24
|
this code worked properly only if commits called before operators second insert must be failed but locked. is it bug or feature ? use DBI; # create table ltab (a int not null,name char(15) not null, # constraint ltab_pk primary key ( a ,name )); # my $dbname='localhost:/tmp/z.gdb'; my $dbh1 = DBI->connect("dbi:InterBase:db=$dbname;ib_dialect=3", 'sysdba','masterkey', {AutoCommit => 0,RaiseError => 1 }) || die "can't connect\n"; my $dbh2 = DBI->connect("dbi:InterBase:db=$dbname;ib_dialect=3", 'sysdba','masterkey', {AutoCommit => 0,RaiseError => 1 }) || die "can't connect\n"; $dbh1->func( -access_mode => 'read_write', -lock_resolution => 'no_wait', 'set_tx_param'); $dbh2->func( -access_mode => 'read_write', -lock_resolution => 'no_wait', 'set_tx_param'); $stmt = "INSERT INTO ltab VALUES(?, 'Yustina')"; $dbh1->commit; # if this commits not called - tpb will lost ! $dbh2->commit; $dbh1->do($stmt, undef, 1); # must pass $dbh2->do($stmt, undef, 1); # must fail $dbh1->commit; $dbh2->commit; $dbh1->disconnect; $dbh2->disconnect; -- Pavlo |