On 8/22/06, Kevin Carothers <[EMAIL PROTECTED]> wrote:


On 8/22/06, Artem Harutyunyan <[EMAIL PROTECTED]> wrote:

>
> Hi,
>
> >
> >  BEGIN TRANSACTION
> >     write a sales slip
> >     write a journal record
> >
>     write a check record
>
> >      COMMIT
> > END TRANSACTION
> >
>
> But what happens, is  that I can see a 'write a sales slip' result
> before actually doing "commit". Is it normal ?
>

 Yes.  Absolutely- otherwise, how would you know the sales slip record was
written successfully?


After doing $sth->execute("kuku","DADDY"," 3.14"); application goes for
sleep for a minute and only after that $dbh->commit() is called. If I
understand everything correctly, during the sleep period the newly added
entry must not be seen in the table, whereas in my case I can see it by
simply doing SELECT from mysql command prompt.
For the test, I have tried to call $dbh->rollback() instead of
$dbh->commit(), but it didn't gave any result (the new entry still was
there).

Maybe your app will be better served with a trigger  construct (I think
this is MySQL 5.0.2).


Thanks for the advice, but what I really need is transactions :).

Artem.

KC


Reply via email to