From: Jurgen Defurne <jurgen.defurne@pandora.be>
To: Andrew McMillan <andrew@catalyst.net.nz>
Cc: PHP PostgreSQL <pgsql-php@postgresql.org>
Subject: Re: using CURSOR with PHP
Date: Wed, 29 May 2002 18:13:38 +0200
Message-ID: <3CF4FE32.54ED8C7D@pandora.be> (raw)
References: <Pine.LNX.4.44.0205281714240.24472-100000@Megathlon.ESI>
<3CF3B04C.89224966@pandora.be>
<1022638250.8777.17.camel@kant.mcmillan.net.nz>
Andrew McMillan wrote:
> PHP implements a bunch of session handling functions. If you desire you
> can use the session ID from these to retrieve a record from the
> database.
>
> For myself, I have developed my own session handling, rather than use
> PHP's. This was perhaps not a good choice, but it is a path I went down
> some years ago now and it is hard to change :-)
>
> PHP sessions do not require the database to be there, of course,
> allowing you to stuff information into an in-memory session structure,
> but this limits the amount of information that can be associated easily.
>
> My own session management does use the database to hold session- and
> user- related information, retrieving (and possibly updating) for each
> page the user visits during their session.
I know what you mean and I have written also this kind of session
handling in Perl, storing session data between CGI invocations in the
file system. One should even be able to define a generic interface and
provide drivers to plug in one's favorite database tool (eg. a
filesystem driver, a DBM driver, a mySQL driver, a postgreSQL driver).
However, that is not what I meant. The type of session management I was
referring to should create a process for every user logged on to the
system. This process should keep the backend from the pgsql database
alive and act as a gateway from PHP to postgreSQL, so that across CGI
invocations you could do the following :
- Startup your connection
- Enter a screen which starts a transaction
- Change data in several screens (still for the same transaction)
- Finally in the last screen, COMMIT or ROLLBACK your transaction
Starting a process, getting a socket and passing the TCP/IP number and
socket back as a session key should not be that hard (I have written
servers in Perl). Then, the interface from PHP should be able to pass
it's pgsql requests to the process using the TCP/IP number and the
socket. It should even be possible to do it synchronous or asynchronous.
It is of course an itch to scratch, but for the moment I am planning the
IT infrastructure of a school (we can start from nil, a good time to put
everything under Linux and OOo).
Regards,
Jurgen Defurne
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-php@postgresql.org
Cc: jurgen.defurne@pandora.be, andrew@catalyst.net.nz
Subject: Re: using CURSOR with PHP
In-Reply-To: <3CF4FE32.54ED8C7D@pandora.be>
References: <Pine.LNX.4.44.0205281714240.24472-100000@Megathlon.ESI> <3CF3B04C.89224966@pandora.be> <1022638250.8777.17.camel@kant.mcmillan.net.nz> <3CF4FE32.54ED8C7D@pandora.be>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox