Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Re: [PEAR] Issues using MDB2 with the DataObject cvs, possible MDB2 problem :)
On 5/29/05, Dan Rossi <pear@electroteque.org> wrote:
> Hi there, some issues have arisen upgrading my MDB2 package. It has
> been working fine, I reverted my hacked up DataObject back to cvs so I
> can start making diffs from some of the changes, so its not that :) It
> only happens when I try and set the debug setting to on
>=20
> MDB2 Error: not supported __sleep : method not supported.
>=20
>=20
> The issue throwing the error is line 2137 of DataObject
> The issue has arisen in line 1573  of MDB2 in the __call method..
>=20
> if (is_null($module)) {
>         ..
>                 ...
>                    ...
>=20
> }
>=20
> This however doesnt happen using DB. It looks like __call is trying to
> call a __sleep module or something ?=20

This is because the debug methods serialize the result object (and
maybe the DB object as well), which calls __sleep. IMHO this really
shouldn't be done on live objects for this exact reason. Look for
__sleep methods in MDB2 or remove the serialize calls from DO's debug
calls.

> My other issue is reverting back
> to DO, another problem has arisen where I was sending the db_options
> from a nested array of the DO settings. I have attempted to set it as a
> staticproperty of $db_options within the constructor of my class where
> I have setup the DO config, however its still not being sent or loaded
> to $db_options within the DO.
>=20
> I set it like this
>=20
> $db_options =3D  PEAR::getStaticProperty('MDB2','options'
);
You need a & above otherwise you're just setting the same variable to
two different copies.
$db_options =3D&  PEAR::getStaticProperty('MDB2','options'
);

> $db_options =3D $this->settings['DB_DataObject']['MDB2'];
No & here, though, or it won't work.

>=20
> Any ideas ?
>=20
> --
> PEAR General Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>=20
>=20


--=20
Justin Patrin

Report this thread to moderator Post Follow-up to this message
Old Post
Justin Patrin
05-30-05 08:57 AM


Re: [PEAR] Issues using MDB2 with the DataObject cvs, possible MDB2 problem :)
On 30/05/2005, at 2:33 PM, Justin Patrin wrote: 
>
> This is because the debug methods serialize the result object (and
> maybe the DB object as well), which calls __sleep. IMHO this really
> shouldn't be done on live objects for this exact reason. Look for
> __sleep methods in MDB2 or remove the serialize calls from DO's debug
> calls.

I just removed the calls to serialize on two of the debug options and
all seems fine. What should I do about it now , i am trying to make my
version in sync with cvs , or else when someone updates pear its going
to break :)

> You need a & above otherwise you're just setting the same variable to
> two different copies.

Woah that was true for PHP5 too ?

Report this thread to moderator Post Follow-up to this message
Old Post
Dan Rossi
05-30-05 08:57 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Pear archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:38 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.