From:             woecherl at mlcomputing dot de
Operating system: Irrelevant
PHP version:      5.2.0
PHP Bug Type:     Feature/Change Request
Bug description:  Persistent Objects in PHP (webserver module)

Description:
------------
PHP has built in the ability to persistently keep e.g. database
connections. Although it is furthermore possible to cache data and objects
e.g. with memcache(d), it is not possible to cache "live" objects which
maintain e.g. socket connections, database result sets (i.e. the
corresponding resource handles) - as soon as the request process/thread is
terminated, all those resources are freed by PHP. 
So my feature request is a function set to
- register an object with PHP as "persistent", with a time-to-live
- "acquire" an object for use in a request (with lock wait timeout)
- "release" an object to give other requests the possibility to use it
- unregister an object (but no immediate destruction, first when it is
unset() or the request terminates )

Example: database query which costs a dear cpu-load to execute
E.g. the result set has 200 records which are displayed in pages
containing 20 results each, with "next results" and "previous results"
links. In a normal PHP application using e.g. a MySQL (or similar)
database, the query has to be executed for each click on "next / previous
results". 
If the result set was persistent for a reasonably limited time, this
unnecessary overhead could be eliminated and thus database server load
reduced.
Similar examples could be found for POP3 or IMAP systems, LDAP
repositories, large XML files processed piece-by-piece, or objects shared
between requests for whatever purpose, and so on.

Or is something like that already existing and I just have not found it?



-- 
Edit bug report at http://bugs.php.net/?id=39743&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=39743&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=39743&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=39743&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=39743&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=39743&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=39743&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=39743&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=39743&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=39743&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=39743&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=39743&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=39743&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=39743&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=39743&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=39743&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=39743&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=39743&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=39743&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=39743&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=39743&r=mysqlcfg

Reply via email to