On Mar 7, 2006, at 8:29 AM, Mark Stosberg wrote:
On Tue, Mar 07, 2006 at 07:45:57AM -0600, Puneet Kishor wrote:
well, if I change
new CGI::Session("driver:sqlite", $sid, {Handle=>$DBH})
to either of the following two choices
new CGI::Session("driver:sqlite", $sid,
{Handle=>DBI->connect("dbi:SQLite:dbname=/path/to/my.db")})
new CGI::Session("driver:sqlite", $sid,
{DataSource=>"dbi:SQLite:dbname=/path/to/my.db"})
The session value gets stored in the database alright, but I get the
following error
(in cleanup) Can't call method "commit" on unblessed reference at
/usr/local/ActivePerl-5.8/lib/site_perl/5.8.7/CGI/Session/Driver/
DBI.pm
line 128
during global destruction.
Does it still happen if you call $ses->flush(); before the script
exits?
Mark, (and others who helped me),
You were right about the above. When I first tried $ses->flush(); by
mistake I didn't put it right before the script ended. The last
statement in my script is, of course,
# send the obligatory Content-Type and print the template
print $cgi->header(-cookie=>$COOKIE), $T->output;
Putting $session->flush(); *after* the above statment clears the error.
Fwiw, I am invoking
new CGI::Session("driver:sqlite", $sid, {Handle=>$DBH})
Phew! Many thanks to you all for patiently holding my hand. I hope, if
this helps making CGI-Session more robust, it was worth it. At the very
least, I got rid of my error.
--
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
|