[Dbi-interbase-devel] Re: commit not committing
Status: Beta
Brought to you by:
edpratomo
From: Adam C. <Ada...@St...> - 2001-10-18 01:05:10
|
I guess this could be a bug. Have you tried doing a seperate prepare and then execute? i.e. my $sth = $dbh->prepare('UPDATE user_info SET unavailable=?') or die $dbh->errstr; $dbh->execute($state) or die $sth->errstr; P.S. (Gratuitous advice :) Note the use of the placeholder ?. Use this instead of string interpolation for safety, security and sanity of your code. A 'do' would look like this ... $dbh->do('UPDATE user_info SET unavailable=?', undef, $state) or die $dbh->errstr; ----- Original Message ----- > Date: Wed, 17 Oct 2001 11:14:11 -0700 > From: Brad Greenlee <br...@fo...> > Sorry to bug you all, but I'm at my wit's end. For some reason, I can't get anything to commit. I'm trying to do an UPDATE to a table, and I've tried every combination of AutoCommit on/off, using the commit statement, using prepare vs. do, etc. The test program below executes just fine, but when I check the table, it isn't updated. If I then type in 'commit' via isql, the update shows up. If I run the script again without having typed commit manually, it deadlocks. > > I've got Interbase SS 6.0.1 running on Linux (RH 7.1), with Perl 5.6.1, and DBD::Interbase 0.28.4. > --------------- BEGIN db_test.pl ---------------- > #!/usr/local/bin/perl > > use DBI; > > my $state = $ARGV[0]; > > # connect to database > my $dbh = DBI->connect("dbi:InterBase:database=/opt/interbase/data/portal.gdb;host=sv- toby",'sysdba','masterkey',{AutoCommit => 1}) or die $dbh->errstr; > > # make all users available > $dbh->do("UPDATE user_info SET unavailable=$state") or die $dbh->errstr; > > # disconnect from database > $dbh->disconnect; > --------------- END db_test.pl ---------------- |