Re: Re: DB_DataObject and transactions

From: Date: Tue, 21 Sep 2004 14:06:01 +0000
Subject: Re: Re: DB_DataObject and transactions
References: 1 2 3 4  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-14576@lists.php.net to get a copy of this message
Alan Knowles wrote:
Laszlo Hermann wrote: $person = DB_DataObject::factory('person');
$conn = & $person->getDatabaseConnection(); $conn->autocommit();
AFAIR - this may fail if you have not disabled overload on PHP4, (due to bugs in the overload extension) which is why the $do->query('BEGIN') is the recommended way to do it.
Will 'BEGIN' work on all databases? So far, I've seen at least five flavours of begin transaction syntax: BEGIN, BEGIN TRANSACTION, SET TRANSACTION, START TRANSACTION and BEGIN WORK, depending on the DBMS. Seems PostgreSQL can cope with all of these except the SET and START syntax, MySQL seems to be able to use BEGIN, BEGIN WORK and START TRANSACTION, Microsoft SQL Server seems to only be able to cope with BEGIN TRANSACTION, but adds the abbreviation BEGIN TRAN to the mix. A pure "BEGIN" would break on this one. Oracle, at least version 7, seems to only understand SET TRANSACTION. Dunno about others. CU Markus

« previous php.pear.general (#14576) next »