Re: (Sloppy correction) Re: session management with database: optimal parameters in php.ini



On 4 mar, 18:34, phicarre <bertaudm...@xxxxxxxxx> wrote:
On 4 mar, 16:51, Erwin Moller



<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
phicarre schreef:

On 4 mar, 13:30, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@xxxxxxxxxxxxxxxx> wrote:
Erwin Moller schreef:

Hi,

It is clearly a long time ago I used frames. ;-)

This is wrong:

2) in frametest.html you simply put:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
   "http://www.w3.org/TR/html4/frameset.dtd";>
<HTML>
<HEAD>
<TITLE>concurrency test</TITLE>
</HEAD>
<FRAMESET rows="5%">
  <FRAME src="phpsessiontest.php">
  <FRAME src="phpsessiontest.php">
  <FRAME src="phpsessiontest.php">
... and 17 more...
</FRAMESET>
</HTML>
This is better:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
    "http://www.w3.org/TR/html4/frameset.dtd";>
<HTML>
<HEAD>
<TITLE>concurrency test</TITLE>
</HEAD>
<FRAMESET
rows="5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%,5%">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
   <FRAME src="phpsessiontest.php">
</FRAMESET>
</HTML>

Regards,
Erwin Moller

PS: I didn't test any of my posted code at all. I wrote it all on top of
my head, so you might find more sloppiness.

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare

Does your suggested link (adodb ...) "conform" to your advices ?

Propably yes, but I never used their db session management myself.

But their package adodb is of good quality. I have been using it for years.
And that db sessionstorage package is made by the same crew, so I expect
it to be allright.

But you can simply check it yourself with the 20 frames. :-)

Regards,
Erwin Moller

--
"There are two ways of constructing a software design: One way is to
make it so simple that there are obviously no deficiencies, and the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult."
-- C.A.R. Hoare

My module doesn't pass your suggested test !!!
The result is: 2 3 3 4 4 5 5 6 7 7 8 9 10 11 12 13 14 15 16 17

I see two possibilities:
-1- to lock/unlock into open/close
-2- to lock/unlock the row of the session

-1- the equivalent of session_start() in the handler is open read
write close
with one global variable set to 1 if 0 in open and to 0 if 1 in close
but I don't know if the ORWC sequence is ALWAYS performed.

-2- with a transaction, write lock the row during the read, then
update row and commit the transaction.
but I believe that we cannot lock one row in mySQL ?
and I am afraid by the deadlocks ...

What do you think about that ? other solution ?
.



Relevant Pages