The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mysql::Locker - Safe way of locking and unlocking MySQL tables.

SYNOPSIS

 use Mysql::Locker;

 # Create table locks
 my $locker = new Mysql::Locker($dbh,
                                {'Customers' => 'READ',
                                 'Articles' => 'WRITE'});

 # Execute some tricky statements here...

 # Locks are automically released when $locker goes out of scope.
 undef($locker);

DESCRIPTION

Mysql::Locker is a simple class for safely using MySQL locks. Locks are created when you instantiate the class and are automatically released when the object goes out of scope (or when you call undef on the object). One situation where this class is useful is when you have persistent database connections such as in some mod_perl scripts and you want to be sure that locks are always released even when a script dies somewhere unexpectedly.

CLASS METHODS

new ($dbh,$locks);

Returns a new Mysql::Locker object.

HISTORY

Version 1.00 2002-01-02

Initial version

AUTHOR

Craig Manley c.manley@skybound.nl

COPYRIGHT

Copyright (C) 2001 Craig Manley <c.manley@skybound.nl>. All rights reserved. This program is free software; you can redistribute it and/or modify it under under the same terms as Perl itself. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.