[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] Autocommmit?



Jay Hannah wrote:
> Ryan Stille wrote:
>> I always leave Autocommit on.  Then in the part of my script that
>> requires transactional processing, I manually issue something like
>> $dbh->do("BEGIN TRANSACTION") then when I've executed all the SQL
>> statements I need to be done together I use $dbh->do("COMMIT").  But
>> I suppose I should be switching autocommit on and off when I need it,
>> and then using $dbh->commit.  I think the problem I ran into with
>> that is the DBD driver didn't think the database supported
>> transactions. So I had to do the transaction stuff manually.
> 
> Really? Which database? On a quiz I would have said that wouldn't
> work... :) 

Microsoft SQL.  But we recently migrated to MySQL and I think I am doing
it there still, too.  I am issuing the statements inbetween my manual
transaction statements with $dbh->do().  Maybe if I was using
$sth->execute() it wouldn't work, as you where thinking, because then it
might call COMMIT for me after each statement?

-Ryan