Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.11.5

Request #3640 calling serialize on the DB object causes a disconnect
Submitted: 2005-02-28 18:26 UTC
From: justinpatrin Assigned:
Status: Suspended Package: DB_DataObject
PHP Version: 5.0.3 OS: Linux
Roadmaps: (Not assigned)    

 [2005-02-28 18:26 UTC] justinpatrin
Description: ------------ See DB bug #3594. Then DB_DataObject calls serialize on the DB object DB's __sleep function disconnects, assuming that the object will not be used any more. Daniel has said he'll remove the disconnect, but since serializing the object seems like a very strange thing to do in this case I would suggest making a copy of the DB object and serializing that. e.g.: serialize(clone($_DB_DATAOBJECT['CONNECTIONS'])) If you take this route I suggest changing all serialize calls to work on a clone.


 [2005-02-28 18:32 UTC] justinpatrin
BTW, it would also make a *lot* of sense tome to change the way that debug works. Instead of cloning / serializing large objects and then choosing whether or not to display them check to see if you should display, then serialize them. Perhaps instead of passing in the serialization, pass in the object and let the debug function serialize it if it's an object. It may also be prudent (in this case) to pass the object in by ref. Or perhaps use something like: if ($this->debugLevel() >= 5) { $this->debug(serialize($_DB_DATAOBJECT['CONNECTIONS']), "CONNECT",5); } and perhaps get rid of the ,5 on the call instead of using if (!empty($_DB_DATAOBJECT['CONFIG']['debug']))) which seems to be true most of the time.
 [2005-03-02 03:58 UTC] alan_k
This is a 5.0.3 bug, AFAIR it's been fixed in the next release as well..
 [2009-10-13 05:48 UTC] alan_k (Alan Knowles)
-Status: Verified +Status: Suspended
guess nobody uses 5.0.3...