Edit report at http://bugs.php.net/bug.php?id=39743&edit=1
ID: 39743 Updated by: [email protected] Reported by: woecherl at mlcomputing dot de Summary: Persistent Objects in PHP (webserver module) -Status: Open +Status: Bogus Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: Irrelevant PHP Version: 5.2.0 Block user comment: N Private report: N New Comment: Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely to be the same. Thank you for your interest in PHP. Previous Comments: ------------------------------------------------------------------------ [2006-12-05 14:03:29] woecherl at mlcomputing dot de 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 this bug report at http://bugs.php.net/bug.php?id=39743&edit=1
