1Apache::Session::Lock::UMsyeSrQLC(o3n)tributed Perl DocuAmpeancthaet:i:oSnession::Lock::MySQL(3)
2
3
4
6 Apache::Session::Lock::MySQL - Provides mutual exclusion using MySQL
7
9 use Apache::Session::Lock::MySQL;
10
11 my $locker = Apache::Session::Lock::MySQL->new();
12
13 $locker->acquire_read_lock($ref);
14 $locker->acquire_write_lock($ref);
15 $locker->release_read_lock($ref);
16 $locker->release_write_lock($ref);
17 $locker->release_all_locks($ref);
18
20 Apache::Session::Lock::MySQL fulfills the locking interface of
21 Apache::Session. Mutual exclusion is achieved through the use of
22 MySQL's GET_LOCK and RELEASE_LOCK functions. MySQL does not support
23 the notion of read and write locks, so this module only supports
24 exclusive locks. When you request a shared read lock, it is instead
25 promoted to an exclusive write lock.
26
28 The module must know how to connect to your MySQL database to acquire
29 locks. You must provide a datasource name, a user name, and a
30 password. These options are passed in the usual Apache::Session style,
31 and are very similar to the options for Apache::Session::Store::MySQL.
32 Example:
33
34 tie %hash, 'Apache::Session::MySQL', $id, {
35 LockDataSource => 'dbi:mysql:database',
36 LockUserName => 'database_user',
37 LockPassword => 'K00l'
38 };
39
40 Instead, you may pass in an already opened DBI handle to your database.
41
42 tie %hash, 'Apache::Session::MySQL', $id, {
43 LockHandle => $dbh
44 };
45
47 This module was written by Jeffrey William Baker <jwbaker@acm.org>.
48
50 Apache::Session
51
52
53
54perl v5.28.0 2018-07-14 Apache::Session::Lock::MySQL(3)