Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-16 Thread Josh Whiting
On Wed, Mar 16, 2005 at 06:59:43PM +0100, Marek Kilimajer wrote: > >SO, does anyone have some code that uses MySQL to replace PHP's native > >session storage that also correctly handles this concurrency problem? > >Ideally I'd like to see just a set of functions that can be used with > >sessions_

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-16 Thread Marek Kilimajer
Josh Whiting wrote: I've been trying to switch to MySQL-based session storage instead of the native PHP session storage. In doing so, I've run into a lot of code on the web that exhibits a serious flaw regarding concurrent requests from the same client. All the code I've seen has glossed over t

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-15 Thread Brian
session_write_close() is also nice in that freeing the lock doesn't destroy your existing copy of the session variables, you can still use them in the rest of your script just remember that they exist in your current script as they were when you called session_start(), even if some other script mod

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-12 Thread Josh Whiting
On Fri, Mar 11, 2005 at 09:57:46AM -0800, Richard Lynch wrote: > > well the trouble is not in the writing at the end of the request, which > > would likely only be a single query and therefore not need a transaction > > in itself. the trouble is the lack of locking out other requests from > > readi

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-11 Thread Richard Lynch
> On Wed, Mar 09, 2005 at 02:52:52PM -0800, Richard Lynch wrote: >> > Agreed, initially I thought of that but I also need to use >> transactions >> > in my business logic and MySQL doesn't support nested transactions, so >> > I'd have to open a separate connection to the DB to handle the session >>

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-10 Thread Josh Whiting
On Wed, Mar 09, 2005 at 02:52:52PM -0800, Richard Lynch wrote: > > Agreed, initially I thought of that but I also need to use transactions > > in my business logic and MySQL doesn't support nested transactions, so > > I'd have to open a separate connection to the DB to handle the session > > transa

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-09 Thread Richard Lynch
> Agreed, initially I thought of that but I also need to use transactions > in my business logic and MySQL doesn't support nested transactions, so > I'd have to open a separate connection to the DB to handle the session > transaction while another connection handles the business > transaction(s).

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-08 Thread Josh Whiting
On Tue, Mar 08, 2005 at 10:38:28AM -0800, Richard Lynch wrote: > Josh Whiting wrote: > > SO, does anyone have some code that uses MySQL to replace PHP's native > > session storage that also correctly handles this concurrency problem? > > Create your MySQL session tables using ENGINE=innoDB (in old

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-08 Thread Richard Lynch
Josh Whiting wrote: > SO, does anyone have some code that uses MySQL to replace PHP's native > session storage that also correctly handles this concurrency problem? Create your MySQL session tables using ENGINE=innoDB (in older MySQL, use TYPE=innoDB) http://mysql.com can tell you lots more about

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-06 Thread Josh Whiting
On Sun, Mar 06, 2005 at 02:27:53PM +, Chris Smith wrote: > Josh Whiting wrote: > >I've been trying to switch to MySQL-based session storage instead of the > >native PHP session storage. In doing so, I've run into a lot of code on > >the web that exhibits a serious flaw regarding concurrent req

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-06 Thread Chris Smith
Josh Whiting wrote: I've been trying to switch to MySQL-based session storage instead of the native PHP session storage. In doing so, I've run into a lot of code on the web that exhibits a serious flaw regarding concurrent requests from the same client. All the code I've seen has glossed over t

[PHP] warning & question about mysql sessions & concurrency

2005-03-05 Thread Josh Whiting
I've been trying to switch to MySQL-based session storage instead of the native PHP session storage. In doing so, I've run into a lot of code on the web that exhibits a serious flaw regarding concurrent requests from the same client. All the code I've seen has glossed over the need to lock the