NYCPHP Meetup

NYPHP.org

[nycphp-talk] when MySQL "rollback" doesn't

David Mintz dmintz at davidmintz.org
Thu Mar 25 09:46:13 EST 2004


I figured out what was going on and thought I'd follow up, if only for the
sake of someone else who encounters this down the road and searches the
list archives for help.

It appears -- according to my experiments -- that if you lock and unlock
table X inside a transaction and then try to roll back an update to table
X, it will won't roll back. Evidently you need to roll back before you
unlock.

Perhaps this is obvious to those who are more knowledgeable, but to me it
wasn't, and I didn't find any relevant clues from RTFM. books, or google.
My several hours of head-banging may have been inefficient, but not
completely unproductive (-:


On Tue, 23 Mar 2004, Daniel Convissor wrote:

> Hi David:
>
> On Tue, Mar 23, 2004 at 04:04:30PM -0500, David Mintz wrote:
>
> > classes and objects in PHP4 that I'm running into? I'm working with 4.3.4
> > and Win2K and MySQL 4.0.13-max-nt-log.
> ... snip ...
> > btw I have run little tests where I do stuff with the same tables, and
> > roll it back, but without using these objects/classes, and it works. So it
> > isn't something stupid like wrong table type.
>
> Not to doubt you, but, uh, I guess I will, you're using innodb tables,
> right?  Okay, you are.  So, you've got a bug in your code.  Echo out each
> query before you execute it.  Make sure the scripts/queries are executing
> in the order you expect.  Then, if that doesn't get you no love, go to the
> length of copying/pasting the queries in the same order into a MySQL
> command line shell.



---
David Mintz
http://davidmintz.org/

        "Anybody else got a problem with Webistics?" -- Sopranos 24:17



More information about the talk mailing list