Subject | Re: Problem with ADODB and transaction handling |
---|---|
Author | mi_whitebrook_13 |
Post date | 2004-11-22T21:01:49Z |
> PHP4 or PHP5?PHP 4.3.9
> I manage 'saves' independent of the queries, so that is probablywhy I
> am not seeing any problem. I presume you are getting some parts ofa
> 'package' committed where you had expected the whole to be rolledback
> after a problem. Starting and Stopping transactions manually may bei am doing the following (in pseudo-php-code):
> needed rather than just relying on the default actions.
create and connect
StartTrans()
insert/update some stuff
calculate some stuff
if(some_error)
die("some error");
insert/update some stuff
if(send_email()!=SUCCESS)
die("email could not be sent!");
CompleteTrans()
the transaction should be rolled back if the CompleteTrans() is not
reached, but instead it is commited. this is because ADOdb continues
to use the link_identifier and does not start a transaction and use
the transaction_identifier. if i do a manual rollback before a die()
it also works. but you cannot say where in a complex script there can
be an error and put an rollback everywhere.
> See http://www.php.net/manual/en/function.ibase-trans.php for thewell, as far as i understand the changes between php4 and php5 i think
> changes between PHP4 and PHP5
this problem will not occur with php5.