CGI-Session-Driver-flexmysql

 view release on metacpan or  search on metacpan

lib/CGI/Session/Driver/flexmysql.pm  view on Meta::CPAN

is doing. In general, session data is not important and we can assume
all other applications should have priority with regard to everything.
Also, even though CGI::Session::MySQL obtains the locks, it would still
overwrite the data as soon as the "other thread" releases its lock,
which means that if two clients are using the same session id, the
locking gives absolutely no protection. MySQL already guranatees that
data is not corrupted when we update the same row from different
places at nearly the same time because it uses a queue for the requests.
It would be different if, once it detected that there is a lock, it
read the data again and SYNCHRONIZED it before updating. Then locking
would be helpful because no other client could synchronize at the same
time. But CGI::Session::MySQL doesn't actually do anything that requires
locking. 

A real use for locking would be to actually lock the session data while
the it's being used.  GET_LOCK and RELEASE_LOCK are usually not the
appropriate way to do this, especially for non-cgi applications where
the session may be in use for a considerable amount of time. I propose
that this locking be done using an extra field. GET_LOCK and RELEASE_LOCK
would be appropriate for locking the row while this extra locking field
is being checked and updated, and then this extra locking field would 
tell other processes using FlexMySQL whether they can read or write the
session data. 

Right now I don't have a need for this kind of locking, so it's not
implemented.  If you want it, you can either send me a patch or roll your
own CGI::Session subclass. Asking me very nicely will also work.

=head1 COPYRIGHT

CGI::Session::Driver::flexmysql is Copyright (C) 2004-2005 Jonathan Buhacoff.  All rights reserved.

This library is free software and can be modified and distributed under the same
terms as Perl itself. 


=head1 AUTHOR

Jonathan Buhacoff <jonathan@buhacoff.net> wrote CGI::Session::Driver::flexmysql

=head1 SEE ALSO

=over 4

=item *

L<CGI::Session::Driver::mysql|CGI::Session::Driver::mysql> - The original MySQL driver for CGI::Session
written by Sherzod Ruzmetov <sherzodr@cpan.org>. Kudos
to Sherzod for making such a great session management framework.

=item *

L<CGI::Session|CGI::Session> - CGI::Session manual

=item *

L<CGI::Session::Tutorial|CGI::Session::Tutorial> - extended CGI::Session manual

=item *

L<CGI::Session::CookBook|CGI::Session::CookBook> - practical solutions for real life problems

=item *

B<RFC 2965> - "HTTP State Management Mechanism" found at ftp://ftp.isi.edu/in-notes/rfc2965.txt

=item *

L<CGI|CGI> - standard CGI library

=item *

L<Apache::Session|Apache::Session> - an alternative to CGI::Session

=back

=cut



( run in 0.883 second using v1.01-cache-2.11-cpan-6aa56a78535 )