logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Trouble with C::S::SQLite: msg#00014

Subject: Re: Trouble with C::S::SQLite
Ok, making progress.

I modified the CGI/Session/Driver/sqlite.pm like so --

sub store {
    my $self = shift;
    my ($sid, $datastr) = @_;
return $self->set_error("store(): usage error") unless $sid && $datastr;

    #my $dbh = $self->{Handle};
my $dbh = DBI->connect("dbi:SQLite:dbname=/path/to/my.db") or die "Db connect failed: $DBI::errstr"; my $sth = $dbh->prepare("SELECT id FROM " . $self->table_name . " WHERE id=?");

And it works just fine. My session value is stored in the sessions table, and reused properly. So, the error is in the way $dbh is being passed. I am using the following syntax in my calling script --

    new CGI::Session("driver:sqlite", $sid, {Handle=>$dbh})

and that is not working... the db handle is getting messed up. Any ideas from this little experiment, anyone?


On Mar 6, 2006, at 9:30 PM, Ron Savage wrote:

On Mon, 6 Mar 2006 21:18:09 -0600, Puneet Kishor wrote:

Hi Puneet

34= sub store {
35=     my $self = shift;
36=     my ($sid, $datastr) = @_;
37=     return $self->set_error("store(): usage error") unless $sid
&& $datastr;
38=
39=     my $dbh = $self->{Handle}; 40=
41=     my $sth = $dbh->prepare("SELECT id FROM " . $self-
table_name . " WHERE id=?");

At this point I would write the value returned by $self -> table_name()
to the web server's log, or to a disk file. That will tell you /exactly/ what
the program thinks the table's name is.

42=     unless ( defined $sth ) {
43=         return $self->set_error( "store(): \$sth->prepare
failed with message " . $dbh->errstr );
44=     } .



--
Puneet Kishor



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>