> On Jul 31, 2017, at 5:54 PM, Johannes Schlüter <johan...@schlueters.de> wrote:
> 
> On Mo, 2017-07-31 at 14:49 +0300, Andrew Nester wrote:
>> That’s actually the thing that you can’t use
>> PDO::ATTR_STATEMENT_CLASS with persistent PDO.
> 
> The actually question is: Why not? - From a quick glance on the code I
> see no obvious reason. In speculation I assume the implementor thought
> "Well, we can't guarantee that a class that is there in one request
> will be there on the next release and it will quite certainly be at a
> different memory address thus the cached class_entry pointer will be
> wrong" but the user has to reset the attribute anyways ... we just have
> to make sure the different dbh->def_stmt_flags are clean when a new PDO
> connection object is created recovering an old connection ...
> 
> johannes

Besides code style/architecture things (which is of course questionable) the 
issue with ATTR_STATEMENT_CLASS is that it simply doesn’t work with persistent 
PDO connect and raises 
"General error: PDO::ATTR_STATEMENT_CLASS cannot be used with persistent PDO 
instances"

Reply via email to