| NAME |
| Synopsis |
| Description |
| Driver Arguments |
| Backwards Compatibility |
| The sessions table |
| Distributions |
| Credits |
| Author |
| Copyright |
CGI::Session::Driver::oracle - A CGI::Session driver for Oracle
$s = CGI::Session -> new('driver:Oracle', $sid);
$s = CGI::Session -> new('driver:Oracle', $sid,
{
DataSource => 'dbi:Oracle:test',
User => 'sherzodr',
Password => 'hello',
});
$s = CGI::Session -> new('driver:Oracle', $sid, {Handle => $dbh});
or
$s = new CGI::Session('driver:Oracle', undef,
{
TableName=>'session',
IdColName=>'my_id',
DataColName=>'my_data',
Handle=>$dbh,
});
CGI::Session::Driver::oracle stores session records in an Oracle table. For details see CGI::Session::Driver::DBI, its parent class.
The CGI::Session::Driver::oracle driver supports all the arguments documented in CGI::Session::Driver::DBI. In addition, the DataSource argument can optionally leave the leading "dbi:Oracle:" string out:
$s = CGI::Session -> new('driver:Oracle', $sid, {DataSource => 'shopping_cart'});
# is the same as:
$s = CGI::Session -> new('driver:Oracle', $sid, {DataSource => 'dbi:Oracle:shopping_cart'});
For backwards compatibility, you can also set the table like this before calling new(). However, it is not recommended because it can cause conflicts in a persistent environment.
$CGI::Session::Oracle::TABLE_NAME = 'my_sessions';
sessions tableThe CGI::Session::DBI docs recommend using this SQL create statement:
create table sessions
(
id char(32) not null unique,
a_session text not null
);
Under Oracle, change the column type of the a_session column from text to long, and if you use Class::DBI::Loader, which wants a primary key in every table, change the definition of your id column too. Thus you want:
create table sessions
(
id char(32) not null primary key, # I.e.: 'unique' => 'primary key'.
a_session long not null # I.e.: 'text' => 'long'.
);
This module is available both as a Unix-style distro (*.tgz) and an ActiveState-style distro (*.ppd). The latter is shipped in a *.zip file.
See http://savage.net.au/Perl-modules/html/installing-a-module.html for help on unpacking and installing each type of distro.
This code is partially copied from the corresponding MySql driver by Sherzod Ruzmetov and the Postgres driver by Cosimo Streppone.
CGI::Session::Driver::oracle was written by Ron Savage
in 2005.
Home page: http://savage.net.au/index.html
Australian copyright © 2005, Ron Savage. All Programs of mine are 'OSI Certified Open Source Software'; you can redistribute them and/or modify them under the terms of The Artistic License, a copy of which is available at: http://www.opensource.org/licenses/index.html