Hi,
I think I also need to detail more about the problem i met with %udat using Apache::Session::File before jump to Apache::Session::DBI because the latter might also expose the same 'unsync %udat' problem.
Let me use these script segments to describe the odd output i met using %udat with Apache::Session::File:
script#1:
...
[+ $udat{any} +]
[- $udat{any}=99 -]
...display a form with action='script#2'
...
script#2:
...before here, $udat{any} should be 99 ...
delete $udat{any};
$req_rec->header_out(Location=>'script#1'); (please ignore #
here)
$req_rec->status(REDIRECT);
exit;
My Embperl is 1.2b9.
My Apache::Session is 1.02.
The odd i saw is:
'Sometimes' the script#1 wrongly displays 99 when the form in script#1 is submitted. But it should display a empty string. The error rate is about 50%. So I guess it is a problem of race condition, something like this (i guess): Before %udat is saved to FileStore, shortly after the httpd serving script#2 sends HTTP Location header to browser and request back to run script1, the new request to run script#1 is served by another httpd and this second httpd is forked before the first httpd exits. The Session module in 2nd httpd fetchs the wrong 'obsoleted' version of %udat because the new %udat is not yet saved in time by 1-st httpd's Session module.
I guess it's kind of race condition because if I remove the location redirection code and manually fetch script#1 immediately after script#2 ends, everything is OK all the time. But that makes my web page very unfriendly and unacceptable. In my web, I heavily use %udat and redirection to pass big fields among scripts of the same session.
I have no time to wait for patch (if any). Is there any method I can call to "sync" %udat before I call $req_rec->status(REDIRECT)? I think this is the fastest remedy to me.
Looking forward to any advance on this. Hoping my problem description here is clear enough.
Thanks.
Huang-Ming
[EMAIL PROTECTED] �g�D�G
Hi,Thanks to Embperl I almost done my web. But then I found serious abnormality on session handling (%udat) when used with HTTP redirection (ie. $req_rec->status(REDIRECT)). Sometimes %udat works OK, sometimes it still remains old data, especially after redirection is processed by another httpd. (race condition?)
I'm tired of Apache::Session::FIle. Besides I need to use %mdat as well. So as advised I turn to Apache::Session::DBI. But it is worse. The first access of %udat caused httpd to crash with panic message as follows:
[183] SES: Embperl Session Management enabled (1.xx)
panic restartop
panic: POPSTACK
Callback called exit.
Callback called exit.What's wrong?
I'm using Embperl 1.2b9 and Apache::Session 1.02.
My httpd.conf looks like:
#...(my old setting)...
#PerlSetEnv EMBPERL_SESSION_CLASSES "FileStore SysVSemaphoreLocker"
#PerlSetEnv EMBPERL_SESSION_ARGS "Directory=/tmp"
#PerlModule Apache::Session::File#...new setting...it never works but panic...
PerlSetEnv EMBPERL_SESSION_CLASSES "DBIStore SysVSemaphoreLocker"
PerlSetEnv EMBPERL_SESSION_ARGS "DataSource=DBI:mysql:mydb UserName=panpipi Password=helpme"
PerlModule Apache::Session::DBI (Apache::Session neither works)#...this neither works. why?...
PerlSetEnv EMBPERL_COOKIE_DOMAIN ".myxxx.com"
PerlSetEnv EMBPERL_COOKIE_PATH "/"
PerlSetEnv EMBPERL_COOKIE_EXPIRES "+1Y"What do I need to do with my database to work with Apache::Session? I mean what tables or database schema are necessary for this session handling to work?
PS. Besides, what's CVS version?
Huang-Ming
