php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #39743 Persistent Objects in PHP (webserver module)
Submitted: 2006-12-05 14:03 UTC Modified: 2011-01-01 23:51 UTC
Votes:3
Avg. Score:4.7 ± 0.5
Reproduced:3 of 3 (100.0%)
Same Version:2 (66.7%)
Same OS:2 (66.7%)
From: woecherl at mlcomputing dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.0 OS: Irrelevant
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: woecherl at mlcomputing dot de
New email:
PHP Version: OS:

 

 [2006-12-05 14:03 UTC] 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?



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-01 23:51 UTC] jani@php.net
-Status: Open +Status: Bogus -Package: Feature/Change Request +Package: *General Issues
 [2011-01-01 23:51 UTC] jani@php.net
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.


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 14:04:04 2025 UTC