Using PDO with APC

From: Date: Thu, 20 Sep 2007 09:45:54 +0000
Subject: Using PDO with APC
Groups: php.db 
Request: Send a blank email to php-db+get-44020@lists.php.net to get a copy of this message
Howdy, I'm attempting to implement APC into my framework, but running into some issues. I'm using PostgreSQL 8.2 with PDO, on PHP 5.2.2 running on Gentoo Linux. When ever I attempt to save my result set obtained from the database into the APC cache, it throws an exception with the following message: 'You cannot serialize or unserialize PDOStatement instances'. Stack trace shows the __sleep() method on the PDOStatement throws the exception when it is called inside apc_store(). I've attempted to use ObjectArray from SPL, however you seem to loose the methods on the object, which is clearly no good for me either. Has anyone got APC working with PDOStatement result sets? Cheers, James

« previous php.db (#44020) next »