Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author Soenke Ruempler - NorthClick <soenke.ruempler@northclick.de>
Full name Soenke Ruempler - NorthClick <soenke.ruempler@northclick.de>
Date 2006-11-17 08:12:26 PST
Message Hans Lellelid <mailto:hans at velum dot net> wrote on Friday, November 17, 2006
5:03 PM:

> Hi Soenke,
>
> Oh, ok -- I was thinking we would set it in Propel class (probably
> getConnection() method?), but this certainly works too. I
> don't know if
> there's an advantage to one over the other.

Yeah, I'm fine with getConnection(), too, as this will save the additional
PDO constructor.

Index: Propel.php
====================​====================​====================​=======
--- Propel.php (revision 497)
+++ Propel.php (working copy)
@@ -442,6 +442,13 @@
                        try {
                                $con = new PropelPDO($dsn, $user, $password,
$driver_options);
                                $con->setAttribu​te(PDO::ATTR_ERRMODE​,
PDO::ERRMODE_EXCEPTION);
+
+ // Toggle PS Emulation for MySQL driver as
the native server-side
+ // implementation seems to be buggy and slow
+ if
($con->getAttrib​ute(PDO::ATTR_DRIVER​_NAME) == 'mysql') {
+
$con->setAttribu​te(PDO::ATTR_EMULATE​_PREPARES, true);
+ }
+
                                self::$connectionMap[$name] = $con;
                        } catch (PDOException $e) {
                                throw new PropelException("Unable to open
PDO connection", $e);
-soenke