Date: 07/15/00
- Next message: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Previous message: Luca - De Whiskey's - De Vitis: "[phplib] template->parse()"
- Next in thread: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Reply: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
hi all,
[system: rh6.1, apache with statically compiled php4.0, mysql 3.23.xxx,
phplib 7.2]
I was playing with phplib for a while, as I thought about using it in an
opensource project (CaupoShop - www.caupo.de - we plan to rewrite it
completely), and accidentaly jumped on a small problem: calling
page_close() from time to time resulted in such a nasty exception:
----------------------------------------------------------
Debug: query = select val from active_sessions where sid =
'05528931af4608b7953152a8baeb08a9' and name = 'CaupoSession'
Debug: query = DELETE FROM active_sessions WHERE changed <
'20000714153315' AND name = 'CaupoSession'
Debug: query = select * from category where parent_id = ''
Debug: query = update active_sessions set
val='Q2F1cG9TZXNzaW9uOiR0aGlzLT5pbiA9ICcnOyAkdGhpcy0+cHQgPSBhcnJheSgpOyA=',
changed='20000715153315' where
sid='05528931af4608b7953152a8baeb08a9' and name='CaupoSession'
Debug: query = insert into active_sessions ( sid, name, val, changed )
values ('05528931af4608b7953152a8baeb08a9', 'CaupoSession',
'Q2F1cG9TZXNzaW9uOiR0aGlzLT5pbiA9ICcnOyAkdGhpcy0+cHQgPSBhcnJheSgpOyA=',
'20000715153315')
Database error: Invalid SQL: insert into active_sessions ( sid, name, val,
changed ) values ('05528931af4608b7953152a8baeb08a9', 'CaupoSession',
'Q2F1cG9TZXNzaW9uOiR0aGlzLT5pbiA9ICcnOyAkdGhpcy0+cHQgPSBhcnJheSgpOyA=',
'20000715153315')
MySQL Error: 1062 (Duplicate entry
'05528931af4608b7953152a8baeb08a9-CaupoSession' for key 2)
Session halted.
-----------------------------
after messing with it for a while, I noticed that it happens only if you
refresh the page (which currently does nothing except page_open() and
page_close()) a few times per second. after messing another bit, I
discovered that in the cases where this exception occurs the
CT_Sql->ac_store($id, $name, $str) checking how many rows were
updated, db->affected_rows() returns 0.
therefore, my guess would be that if you update the row in mysql table
(active_sessions in my case) and the data that must be updated (field
'changed' in my case) is intact, nothing happens, and affected_rows()
returns 0 in that case.
I have seen a couple of postings in the archives about this problem, but
haven't seen any suggestions how to fix it though. any ideas?
--andrius
Andrius Juozapaitis
~living source
---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>
- Next message: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Previous message: Luca - De Whiskey's - De Vitis: "[phplib] template->parse()"
- Next in thread: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Reply: Kristian Koehntopp: "Re: [phplib] problem with active_sessions"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

