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

OpenInteract2::Session::SQLite - Create sessions within a SQLite data source

SYNOPSIS

 # In your server configuration file:

 # Option 1: Specify the database name directly (use only when SQLite
 # is only being used for sessions)
  
 [session_info]
 class       = OpenInteract2::Session::SQLite
 impl_class  = Apache::Session::SQLite
 ...
 
 [session_info.params]
 dbname = /home/httpd/oi/conf/sqlite_sessions
 ...

 # Option 2: Specify a datasource
 [session_info]
 class       = OpenInteract2::Session::SQLite
 impl_class  = Apache::Session::SQLite
 datasource  = main
 ...

DESCRIPTION

Provide a '_create_session' method for OpenInteract2::Session so we can use a SQLite data source as a backend for Apache::Session::SQLite.

This code is fairly untested under normal server loads and multiple processes. I do not know what the behavior of SQLite is with many concurrent reads and writes -- you might want to read the SQLite documentation about modifying the attributes of the data file so that every write is not synchronized with the filesystem.

METHODS

_validate_config( $session_config )

Ensure our configuration is properly defined. One of the following entries must be defined:

  • session_info.datasource

    Specify the datasource to use. This should be defined just like any other OI2 datasource.

  • session_info.params.dbname

    Specify the SQLite file used for serializing sessions.

No matter which option you choose the resulting SQLite file should already have the 'sessions' table defined.

_create_session( $session_config, [ $session_id ] )

Overrides the method from parent OpenInteract2::Session, serializing sessions to and from a file named in the configuration.

SEE ALSO

DBD::SQLite

Apache::Session::SQLite

OpenInteract2::Session

COPYRIGHT

Copyright (c) 2001-2003 Chris Winters. All rights reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHORS

Chris Winters <chris@cwinters.com>