perl-embperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eitan Suez" <>
Subject re: setting up session using oracle store..
Date Thu, 21 Dec 2000 17:23:39 GMT
hi gerald,

  here are answers to your questions..

> BTW. Which Perl version do you use ?

version 5.005_03 build for sun4-solaris

> Did you run your test script also under mod_perl or from the command line?

my test scripts were command line scripts.  i used two scripts:  one creates
a session and stores some info, and retrieves the key.  the other deletes
the session.  here's the code for the first script:

    use Apache::Session::Oracle;

    $ENV{"ORACLE_HOME"} = "/home/oracle/app/oracle/8.1.6";
    my %session;
    tie %session, 'Apache::Session::Oracle', undef,
       { DataSource=> 'dbi:Oracle:conn_fino', UserName=>'xxx',
Password=>'yyy', Commit=>'1' };

    $session{myname} = "eitan suez";
    my $id = $session{_session_id};

    print "id is: $id\n";

after running this script, i can do a sql "select" against the table
named "sessions" (setup ahead of time) and i will see a row with the
same key as $id (and a value which is a serialized form of the data
stored in the session.

> Can you access your Oracle database within a Embperl page by normal DBI ?

yes.  been doing that for a while now.

> Using Oracle under mod_perl you need to make sure the ORACLE_HOME is set
> for your web pages (i.e. with PerlSetEnv, PerlPassEnv)

oracle_home is set properly.  actually, if i remove the setting of the
environment variable, i do get the proper error/warning:

>> Warning in Perl code: ORACLE_HOME environment variable not set! <<

a similar error comes up when env var is set but to an incorrect
value.  so i'm fairly sure that a connection is actually established
when the session is created.

what i can't figure out is why the session data is not saved.

thanks, eitan

View raw message