> b) Two different servers (or the same server) trying to access the
> session data for the same SID at the same time. How can a user of SM
> generate two accesses to session data at the same time?. And how do you
> use SM to generate two pararell accesses from two different webservers
> in the cluster?

Let's assume you've got two LB'd web servers balanced by rr.  One click in
left_main, say, "check mail," generates one session hit on the first server.  
The
second click, say, selecting a message, generates a second session hit on the
second server.  If they're happening at the same time and your session store 
isn't
lock-safe, you can end up in trouble.  Is that now clear?

> PS.- I do not use locking in my SQL session handler (only normal
> transactions). I have never had (or got reports from other users) about
> this problem, but I am interested in this discusion to find out if in
> theory this can happen in a webcluster running PHP. I am not convinced,
> ... yet ;)

With SQL, you're a little more protected because you do at least have
transactional isolation, but database locks are there for a reason.  Just 
imagine
a scenario where two instances of the same session write to the it the same
variable based on two different values of some other session variable.

I haven't looked at these SQL-based session handler functions in awhile, but I
assume all you'd have to do to make them "balancesafe" would be to change the
SELECT's to SELECT FOR UPDATE's.

That brings up another point though: if PHP's session locking is based on 
flock(),
what do you do to serialize multiple accesses even from the same web server?

John




-- 
John Madden
UNIX Systems Engineer
Ivy Tech State College
[EMAIL PROTECTED]



-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.
Get your fingers limbered up and give it your best shot. 4 great events, 4
opportunities to win big! Highest score wins.NEC IT Guy Games. Play to
win an NEC 61 plasma display. Visit http://www.necitguy.com/?r 
--
squirrelmail-users mailing list
Posting Guidelines: 
http://squirrelmail.org/wiki/wiki.php?MailingListPostingGuidelines
List Address: [email protected]
List Archives: 
http://news.gmane.org/thread.php?group=gmane.mail.squirrelmail.user
List Archives:  http://sourceforge.net/mailarchive/forum.php?forum_id)95
List Info: https://lists.sourceforge.net/lists/listinfo/squirrelmail-users

Reply via email to