{
    "mode": "perldoc",
    "parameter": "Apache::Session::Lock::MySQL",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/Apache%3A%3ASession%3A%3ALock%3A%3AMySQL/json",
    "generated": "2026-06-16T03:13:04Z",
    "synopsis": "use Apache::Session::Lock::MySQL;\nmy $locker = Apache::Session::Lock::MySQL->new();\n$locker->acquirereadlock($ref);\n$locker->acquirewritelock($ref);\n$locker->releasereadlock($ref);\n$locker->releasewritelock($ref);\n$locker->releasealllocks($ref);",
    "sections": {
        "NAME": {
            "content": "Apache::Session::Lock::MySQL - Provides mutual exclusion using MySQL\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "use Apache::Session::Lock::MySQL;\n\nmy $locker = Apache::Session::Lock::MySQL->new();\n\n$locker->acquirereadlock($ref);\n$locker->acquirewritelock($ref);\n$locker->releasereadlock($ref);\n$locker->releasewritelock($ref);\n$locker->releasealllocks($ref);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Apache::Session::Lock::MySQL fulfills the locking interface of Apache::Session. Mutual exclusion\nis achieved through the use of MySQL's GETLOCK and RELEASELOCK functions. MySQL does not\nsupport the notion of read and write locks, so this module only supports exclusive locks. When\nyou request a shared read lock, it is instead promoted to an exclusive write lock.\n",
            "subsections": []
        },
        "CONFIGURATION": {
            "content": "The module must know how to connect to your MySQL database to acquire locks. You must provide a\ndatasource name, a user name, and a password. These options are passed in the usual\nApache::Session style, and are very similar to the options for Apache::Session::Store::MySQL.\nExample:\n\ntie %hash, 'Apache::Session::MySQL', $id, {\nLockDataSource => 'dbi:mysql:database',\nLockUserName   => 'databaseuser',\nLockPassword   => 'K00l'\n};\n\nInstead, you may pass in an already opened DBI handle to your database.\n\ntie %hash, 'Apache::Session::MySQL', $id, {\nLockHandle => $dbh\n};\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "This module was written by Jeffrey William Baker <jwbaker@acm.org>.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "Apache::Session\n",
            "subsections": []
        }
    },
    "summary": "Apache::Session::Lock::MySQL - Provides mutual exclusion using MySQL",
    "flags": [],
    "examples": [],
    "see_also": []
}