PHP Classes
Icontem

Class: Mysql Locker


  Search   All class groups All class groups   Latest entries Latest entries   Top 10 charts Top 10 charts   Newsletter Newsletter   Blog Blog   Forums Forums   Help FAQ Help FAQ  
  Login   Register  
Recommend this page to a friend!
      Classes of Craig Manley  >  Mysql Locker  >  Download  >  Support forum Support forum  >  RSS 1.0 feed RSS 2.0 feed Latest changes  >  Stumble It! Stumble It!  >  Bookmark in del.icio.us Bookmark in del.icio.us  
  Supplied by   Group folder image Groups   Detailed description  
  Rate classes User ratings   Applications   Files Files  
  • Supplied by:

    Picture of Craig Manley
    Name: Craig Manley <e-mail contact>
    Published packages: 5
    Country: The Netherlands The Netherlands - PHP jobs in The Netherlands
    Home page: ???
    Age: ???
    All time rank: 192
    Week rank: 143

    Browse this author's classes

  • Innovation Award:

    PHP Programming Innovation award nominee
    February 2005
    Number 5
    One of the problems of using database transactions, table locks or other means that grant exclusive access to database resources for a running script, is that when that script ends all locks must be released.

    This problem may become critical when the scripts use persistent connections to access the database and the developer forgot to release the locks or the script exited due to an unexpected error.

    When the connections are not persistent, at the end of the script the database connection is closed and all locks are implicitly released.

    However, when the connection is persistent, the database connection is not closed and the locks remain until the current Web server process is terminated. This situation may lock the whole database access for an indefinite period.

    This class provides a solution that uses constructors and destructors functions to establish and release the necessary table locks. Even when a script exits in an unexpected way, the destructor function is always called and any outstanding locks are released.

    Manuel Lemos
  • Groups:

    Group folder image PHP 5 Classes using PHP 5 specific features View top rated classes
    Group folder image Databases Database management, accessing and searching View top rated classes
  • Detailed description:

    This class can safely manage the locking and unlocking of MySQL tables.

    The table locks are created when an object of the class is created, and are automatically released when the object is destroyed.

    The table unlocking occurs when the object is no longer referenced, or when it goes out of scope. The latter also occurs when a PHP script dies or when an exception occurs. This is where this class is most useful because it will make sure that all existing locks are automatically released even when using persistent connections.

    The class takes advantage of PHP 5 class destructor support to make sure that the unlocking of any locked tables always happen.
  • User ratings:

    Not yet rated by the users
  • Applications that use this class:

    No application links were specified for this class.
    Add link image If you know an application of this package, send a message to the author to add a link here.
  • Files:

    File Role Description
    Plain text file MysqlLocker.php Class The only class.
    Plain text file t.php Example Test script.
    Download all files: mysqllocker.tar.gz mysqllocker.zip
    NOTICE: if you are using a download manager program like 'GetRight', please Login before trying to download this archive.

 
  Advertise on this site Advertise on this site   Site map Site map   Statistics Statistics   Site tips Site tips   Privacy policy Privacy policy   Contact Contact  

For more information send a message to :
info at phpclasses dot org.
Copyright (c) Icontem 1999-2008 PHP Classes - PHP Class Scripts
  PHP Book Reviews - Reviews of books and other products