[UPHPU] autocommit() locking tables

Rusty Keele rusty.keele at yahoo.com
Thu Oct 9 10:22:13 MDT 2008


Hi,

  I am trying to find out if using mysqli::autocommit() automatically locks the DB tables that are being used by a query.
  
  Here's my problem: I am looking over some PHP code that is causing intermittent dead lock conditions in a MySQL DB (using InnoDB engine.)  Basically the code creates an array of SQL queries (inserts and updates), turns autocommit off, runs all the queries, then commits them:

            $conn->autocommit(false);
            $this->PersistCache();
            $conn->commit();

      The PersistCache() method just loops through the array and executes each query.  I have looked through the code and don't see an explicit LOCK statement anywhere, so I'm thinking that maybe autocommit() is somehow locking the tables that are being updated.  I have checked out the PHP documentation and it says nothing about locking.  Any ideas?

Thanks,
-Rusty




      


More information about the UPHPU mailing list