Login | Register
My pages Projects Community openCollabNet

Discussions > dev > Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

propel
Discussion topic

Hide all messages in topic

All messages in topic

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 09:59:59 PST
Message That would work ... Certainly it is a hack to wire this stuff into
getConnection(), though I think we could also expect these defaults to
be set at the PDO layer -- if they represent fixes to broken
functionality, especially.

So, we could add something to the DBAdapter, but I'm not sure how much
we need to "systematize" workarounds for buggy low-level database drivers.

Hans

David Zülke wrote:
> Mmmmh my bad I just looked at it again and realized what the adapters
> do. So do we need a similar concept for building connections? Or could
> we simply use the adapters for that? (i.e. MysqlAdapter has default
> options and we read them)
>
>
> David
>
>
> Am 17.11.2006 um 17:47 schrieb David Zülke:
>
>> That seems a tad too hacky for my taste. I understand that we aren't
>> using DBAdapters anymore at all, is that correct? Should we maybe
>> re-introduce some very basic level of abstraction to cater for these
>> specific situations? For instance, what about this SET NAMES utf8 thing?
>> Putting stuff like that into the Propel class makes it next to
>> impossible to customize behavior in userland without patching.
>>
>> I'll be happy to implement the necessary changes should we decide
>> it's necessary or even feasible.
>>
>> Let's hear your thoughts :)
>>
>>
>> David
>>
>>
>> Am 17.11.2006 um 17:31 schrieb Soenke Ruempler - NorthClick:
>>
>>> Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006
>>> 5:22 PM:
>>>
>>>> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
>>>> Friday, November 17, 2006 5:15 PM:
>>>>
>>>>> I guess the options from the runtime conf will be set later? (Just
>>>>> in case anyone ever wants to override the default).
>>>>
>>>> Currently not, but it should, yes.
>>>>
>>>> I don't know if PDO makes a difference between
>>>> driver-specific options and
>>>> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
>>>> constructor-options from $driver_options the same as those
>>>> are passed to
>>>> PDO::setAttribute()?
>>>
>>> Yes they are. Finally:
>>>
>>> Index: Propel.php
>>> ====================​====================​====================​=======
>>> --- Propel.php (revision 497)
>>> +++ Propel.php (working copy)
>>> @@ -429,8 +429,16 @@
>>> $user = isset($conparams['user']) ?
>>> $conparams['user'] : null;
>>> $password = isset($conparams['password']) ?
>>> $conparams['password'] : null;
>>>
>>> + $driver_options = array();
>>> +
>>> + // Toggle PS Emulation for MySQL driver as the
>>> native server-side
>>> + // implementation seems to be buggy and slow.
>>> + // This can be overridden in the connection
>>> parameters
>>> + if (strpos($conparams['dsn'], 'mysql') === 0) {
>>> +
>>> $driver_options[PDO​::ATTR_EMULATE_PREPA​RES]
>>> = true;
>>> + }
>>> +
>>> // load any driver options from the INI file
>>> - $driver_options = array();
>>> if ( isset($conparams['options']) &&
>>> is_array($conparams['options']) ) {
>>> try {
>>> self::processDriverOptions(
>>> $conparams['options'], $driver_options );
>>>
>>> -soenke
>>>
>>> --------------------​--------------------​--------------------​---------
>>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>>
>>>
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com>
Full name =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com>
Date 2006-11-17 08:52:55 PST
Message Mmmmh my bad I just looked at it again and realized what the adapters
do. So do we need a similar concept for building connections? Or
could we simply use the adapters for that? (i.e. MysqlAdapter has
default options and we read them)


David


Am 17.11.2006 um 17:47 schrieb David Zülke:

> That seems a tad too hacky for my taste. I understand that we
> aren't using DBAdapters anymore at all, is that correct? Should we
> maybe re-introduce some very basic level of abstraction to cater
> for these specific situations? For instance, what about this SET
> NAMES utf8 thing?
> Putting stuff like that into the Propel class makes it next to
> impossible to customize behavior in userland without patching.
>
> I'll be happy to implement the necessary changes should we decide
> it's necessary or even feasible.
>
> Let's hear your thoughts :)
>
>
> David
>
>
> Am 17.11.2006 um 17:31 schrieb Soenke Ruempler - NorthClick:
>
>> Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006
>> 5:22 PM:
>>
>>> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
>>> Friday, November 17, 2006 5:15 PM:
>>>
>>>> I guess the options from the runtime conf will be set later? (Just
>>>> in case anyone ever wants to override the default).
>>>
>>> Currently not, but it should, yes.
>>>
>>> I don't know if PDO makes a difference between
>>> driver-specific options and
>>> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
>>> constructor-options from $driver_options the same as those
>>> are passed to
>>> PDO::setAttribute()?
>>
>> Yes they are. Finally:
>>
>> Index: Propel.php
>> ====================​====================​====================​=======
>> --- Propel.php (revision 497)
>> +++ Propel.php (working copy)
>> @@ -429,8 +429,16 @@
>> $user = isset($conparams['user']) ?
>> $conparams['user'] : null;
>> $password = isset($conparams['password']) ?
>> $conparams['password'] : null;
>>
>> + $driver_options = array();
>> +
>> + // Toggle PS Emulation for MySQL driver as
>> the
>> native server-side
>> + // implementation seems to be buggy and slow.
>> + // This can be overridden in the connection
>> parameters
>> + if (strpos($conparams['dsn'], 'mysql') ===
>> 0) {
>> + $driver_options
>> [PDO::ATTR_EMULATE_PREPARES]
>> = true;
>> + }
>> +
>> // load any driver options from the INI file
>> - $driver_options = array();
>> if ( isset($conparams['options']) &&
>> is_array($conparams['options']) ) {
>> try {
>> self::processDriverOptions(
>> $conparams['options'], $driver_options );
>>
>> -soenke
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Full name Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Date 2006-11-17 08:52:07 PST
Message I don't know how much driver-specific things are required, but as long
as it's just attributes I think creating a config file with default
values for each driver (that needs it) would create a nice solution.

Ron

David Zülke wrote:
> That seems a tad too hacky for my taste. I understand that we aren't
> using DBAdapters anymore at all, is that correct? Should we maybe
> re-introduce some very basic level of abstraction to cater for these
> specific situations? For instance, what about this SET NAMES utf8 thing?
> Putting stuff like that into the Propel class makes it next to
> impossible to customize behavior in userland without patching.
>
> I'll be happy to implement the necessary changes should we decide it's
> necessary or even feasible.
>
> Let's hear your thoughts :)
>
>
> David
>
>
> Am 17.11.2006 um 17:31 schrieb Soenke Ruempler - NorthClick:
>
>> Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006
>> 5:22 PM:
>>
>>> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
>>> Friday, November 17, 2006 5:15 PM:
>>>
>>>> I guess the options from the runtime conf will be set later? (Just
>>>> in case anyone ever wants to override the default).
>>>
>>> Currently not, but it should, yes.
>>>
>>> I don't know if PDO makes a difference between
>>> driver-specific options and
>>> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
>>> constructor-options from $driver_options the same as those
>>> are passed to
>>> PDO::setAttribute()?
>>
>> Yes they are. Finally:
>>
>> Index: Propel.php
>> ====================​====================​====================​=======
>> --- Propel.php (revision 497)
>> +++ Propel.php (working copy)
>> @@ -429,8 +429,16 @@
>> $user = isset($conparams['user']) ?
>> $conparams['user'] : null;
>> $password = isset($conparams['password']) ?
>> $conparams['password'] : null;
>>
>> + $driver_options = array();
>> +
>> + // Toggle PS Emulation for MySQL driver as the
>> native server-side
>> + // implementation seems to be buggy and slow.
>> + // This can be overridden in the connection
>> parameters
>> + if (strpos($conparams['dsn'], 'mysql') === 0) {
>> +
>> $driver_options[PDO​::ATTR_EMULATE_PREPA​RES]
>> = true;
>> + }
>> +
>> // load any driver options from the INI file
>> - $driver_options = array();
>> if ( isset($conparams['options']) &&
>> is_array($conparams['options']) ) {
>> try {
>> self::processDriverOptions(
>> $conparams['options'], $driver_options );
>>
>> -soenke
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com>
Full name =?ISO-8859-1?Q?David_Z=FClke?= <dz at bitxtender dot com>
Date 2006-11-17 08:47:19 PST
Message That seems a tad too hacky for my taste. I understand that we aren't
using DBAdapters anymore at all, is that correct? Should we maybe re-
introduce some very basic level of abstraction to cater for these
specific situations? For instance, what about this SET NAMES utf8 thing?
Putting stuff like that into the Propel class makes it next to
impossible to customize behavior in userland without patching.

I'll be happy to implement the necessary changes should we decide
it's necessary or even feasible.

Let's hear your thoughts :)


David


Am 17.11.2006 um 17:31 schrieb Soenke Ruempler - NorthClick:

> Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006
> 5:22 PM:
>
>> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
>> Friday, November 17, 2006 5:15 PM:
>>
>>> I guess the options from the runtime conf will be set later? (Just
>>> in case anyone ever wants to override the default).
>>
>> Currently not, but it should, yes.
>>
>> I don't know if PDO makes a difference between
>> driver-specific options and
>> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
>> constructor-options from $driver_options the same as those
>> are passed to
>> PDO::setAttribute()?
>
> Yes they are. Finally:
>
> Index: Propel.php
> ====================​====================​====================​=======
> --- Propel.php (revision 497)
> +++ Propel.php (working copy)
> @@ -429,8 +429,16 @@
> $user = isset($conparams['user']) ?
> $conparams['user'] : null;
> $password = isset($conparams['password']) ?
> $conparams['password'] : null;
>
> + $driver_options = array();
> +
> + // Toggle PS Emulation for MySQL driver as the
> native server-side
> + // implementation seems to be buggy and slow.
> + // This can be overridden in the connection
> parameters
> + if (strpos($conparams['dsn'], 'mysql') ===
> 0) {
> + $driver_options
> [PDO::ATTR_EMULATE_PREPARES]
> = true;
> + }
> +
> // load any driver options from the INI file
> - $driver_options = array();
> if ( isset($conparams['options']) &&
> is_array($conparams['options']) ) {
> try {
> self::processDriverOptions(
> $conparams['options'], $driver_options );
>
> -soenke
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>

RE: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Full name Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Date 2006-11-17 08:31:55 PST
Message Soenke Ruempler - NorthClick <> wrote on Friday, November 17, 2006 5:22 PM:

> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on
> Friday, November 17, 2006 5:15 PM:
>
>> I guess the options from the runtime conf will be set later? (Just
>> in case anyone ever wants to override the default).
>
> Currently not, but it should, yes.
>
> I don't know if PDO makes a difference between
> driver-specific options and
> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
> constructor-options from $driver_options the same as those
> are passed to
> PDO::setAttribute()?

Yes they are. Finally:

Index: Propel.php
====================​====================​====================​=======
--- Propel.php (revision 497)
+++ Propel.php (working copy)
@@ -429,8 +429,16 @@
                        $user = isset($conparams['user']) ?
$conparams['user'] : null;
                        $password = isset($conparams['password']) ?
$conparams['password'] : null;

+ $driver_options = array();
+
+ // Toggle PS Emulation for MySQL driver as the
native server-side
+ // implementation seems to be buggy and slow.
+ // This can be overridden in the connection
parameters
+ if (strpos($conparams['dsn'], 'mysql') === 0) {
+ $driver_options[PDO​::ATTR_EMULATE_PREPA​RES]
= true;
+ }
+
                        // load any driver options from the INI file
- $driver_options = array();
                        if ( isset($conparams['options']) &&
is_array($conparams['options']) ) {
                                try {
                                        self::processDriverOptions(
$conparams['options'], $driver_options );

-soenke

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Full name Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Date 2006-11-17 08:31:45 PST
Message The php-manual says:

Sets an attribute on the database handle. Some of the available generic
attributes are listed below; some drivers may make use of additional
driver specific attributes.

So it looks to me that you can set driver specific attributes with
setAttribute.

Ron

Soenke Ruempler - NorthClick wrote:
> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on Friday,
> November 17, 2006 5:15 PM:
>
>
>> I guess the options from the runtime conf will be set later? (Just
>> in case anyone ever wants to override the default).
>>
>
> Currently not, but it should, yes.
>
> I don't know if PDO makes a difference between driver-specific options and
> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
> constructor-options from $driver_options the same as those are passed to
> PDO::setAttribute()?
>
> -soenke
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>
>

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 08:31:09 PST
Message Soenke Ruempler - NorthClick wrote:
> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on Friday,
> November 17, 2006 5:15 PM:
>
>
>> I guess the options from the runtime conf will be set later? (Just
>> in case anyone ever wants to override the default).
>>
>
> Currently not, but it should, yes.
>
> I don't know if PDO makes a difference between driver-specific options and
> global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
> constructor-options from $driver_options the same as those are passed to
> PDO::setAttribute()?
>

I believe they are ... but you may want to double-check me :)

Hans

RE: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Full name Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Date 2006-11-17 08:21:36 PST
Message Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on Friday,
November 17, 2006 5:15 PM:

> I guess the options from the runtime conf will be set later? (Just
> in case anyone ever wants to override the default).

Currently not, but it should, yes.

I don't know if PDO makes a difference between driver-specific options and
global attributes like "PDO::ATTR_EMULATE_PREPARES". Are the
constructor-options from $driver_options the same as those are passed to
PDO::setAttribute()?

-soenke

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 08:19:08 PST
Message Yeah, that sounds perfect.

Thanks, Soenke. (Commit at will!)

Hans

Ron Rademaker wrote:
> I guess the options from the runtime conf will be set later? (Just in
> case anyone ever wants to override the default).
>
> Ron
>
> Soenke Ruempler - NorthClick wrote:
>> 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
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Full name Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Date 2006-11-17 08:15:29 PST
Message I guess the options from the runtime conf will be set later? (Just in
case anyone ever wants to override the default).

Ron

Soenke Ruempler - NorthClick wrote:
> 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
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>
>

RE: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Full name Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot 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

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 08:02:56 PST
Message 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.

Hans

Soenke Ruempler - NorthClick wrote:
> Hans Lellelid <mailto:hans at velum dot net> wrote on Friday, November 17, 2006
> 3:19 PM:
>
>
>> Thanks, Soenke, you beat me too it :)
>>
>> Yeah, maybe we could do that by default for MySQL, though it does
>> seem like a bit of a hack. We should probably issue a debug logging
>> statement indicating that we're doing that, if we do turn
>> that on behind
>> the scenes. If you want to look into it, I'd be grateful, as I'm
>> probably not going to get to it today otherwise.
>>
>
> I guess for beta-testing this "hack"/workaround without logging should be
> enough, shouldn't it?
>
> Index: PropelPDO.php
> ====================​====================​====================​=======
> --- PropelPDO.php (revision 497)
> +++ PropelPDO.php (working copy)
> @@ -41,6 +41,22 @@
> class PropelPDO extends PDO {
>
> /**
> + * The constructor - currently just for a MySQL driver workaround
> + *
> + */
> + public function __construct($dsn, $username = null, $password =
> null, array $driver_options = array()) {
> +
> + parent::__construct($dsn, $username, $password,
> $driver_options);
> +
> + // Toggle PS Emulation for MySQL driver as the native
> server-side
> + // implementation seems to be buggy and slow
> + if ($this->getAttri​bute(PDO::ATTR_DRIVE​R_NAME) == 'mysql') {
> + $this->setAttrib​ute(PDO::ATTR_EMULAT​E_PREPARES,
> true);
> + }
> +
> + }
> +
> + /**
> * The current transaction depth.
> * @var int
> */
>
> If no one complains, I'll create a ticket and commit the patch.
>
> -soenke
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>

RE: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Full name Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Date 2006-11-17 08:00:11 PST
Message Hans Lellelid <mailto:hans at velum dot net> wrote on Friday, November 17, 2006
3:19 PM:

> Thanks, Soenke, you beat me too it :)
>
> Yeah, maybe we could do that by default for MySQL, though it does
> seem like a bit of a hack. We should probably issue a debug logging
> statement indicating that we're doing that, if we do turn
> that on behind
> the scenes. If you want to look into it, I'd be grateful, as I'm
> probably not going to get to it today otherwise.

I guess for beta-testing this "hack"/workaround without logging should be
enough, shouldn't it?

Index: PropelPDO.php
====================​====================​====================​=======
--- PropelPDO.php (revision 497)
+++ PropelPDO.php (working copy)
@@ -41,6 +41,22 @@
 class PropelPDO extends PDO {

        /**
+ * The constructor - currently just for a MySQL driver workaround
+ *
+ */
+ public function __construct($dsn, $username = null, $password =
null, array $driver_options = array()) {
+
+ parent::__construct($dsn, $username, $password,
$driver_options);
+
+ // Toggle PS Emulation for MySQL driver as the native
server-side
+ // implementation seems to be buggy and slow
+ if ($this->getAttri​bute(PDO::ATTR_DRIVE​R_NAME) == 'mysql') {
+ $this->setAttrib​ute(PDO::ATTR_EMULAT​E_PREPARES,
true);
+ }
+
+ }
+
+ /**
         * The current transaction depth.
         * @var int
         */

If no one complains, I'll create a ticket and commit the patch.

-soenke

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author hlellelid
Full name Hans Lellelid
Date 2006-11-17 06:18:51 PST
Message Thanks, Soenke, you beat me too it :)

Yeah, maybe we could do that by default for MySQL, though it does seem
like a bit of a hack. We should probably issue a debug logging
statement indicating that we're doing that, if we do turn that on behind
the scenes. If you want to look into it, I'd be grateful, as I'm
probably not going to get to it today otherwise.

Hans

Soenke Ruempler - NorthClick wrote:
> Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on Friday,
> November 17, 2006 3:07 PM:
>
>> That fixes the problem!
>
> http://netevil.org/n​ode.php?uuid=444a601​7-0548-2459-2943-44a​601714d58
>
> We should set PDO::ATTR_EMULATE_PREPARES to true for MySQL by default,
> shouldn't we? Didn't look into the sources if it's easy to add ...
>
> As Wez writes:
>
> "The native prepared statement API is still quite young it seems. I was
> considering making emulated prepares the default, but it seemed like a
> pretty drastic change to make for a minor point release."
>
> We have a semi-major release, so +1 for MySQL and emulation.
>
> I could look into it.
>
> -soenke
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>

RE: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Full name Soenke Ruempler - NorthClick <soenke dot ruempler at northclick dot de>
Date 2006-11-17 06:15:47 PST
Message Ron Rademaker <mailto:r.rademak​er@virtualbuilding.n​l> wrote on Friday,
November 17, 2006 3:07 PM:

> That fixes the problem!

http://netevil.org/n​ode.php?uuid=444a601​7-0548-2459-2943-44a​601714d58

We should set PDO::ATTR_EMULATE_PREPARES to true for MySQL by default,
shouldn't we? Didn't look into the sources if it's easy to add ...

As Wez writes:

"The native prepared statement API is still quite young it seems. I was
considering making emulated prepares the default, but it seemed like a
pretty drastic change to make for a minor point release."

We have a semi-major release, so +1 for MySQL and emulation.

I could look into it.

-soenke

Re: [propel-dev] Re: [propel] Is safe to use propel 1.3?

Reply

Author Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Full name Ron Rademaker <r dot rademaker at virtualbuilding dot nl>
Date 2006-11-17 06:06:45 PST
Message That fixes the problem!

Hans Lellelid wrote:
> Hi Ron,
>
> Ron Rademaker wrote:
>
>> Guess the dev list is more appropriate, so writing to dev now (and
>> cc-ing users).
>>
>> I'm using mysql (on an up to date debian unstable system, php 5.2).
>>
>> It looks like I was wrong with the setLimit / setOffset problems thougt
>> (I was jumping to conclusions based on the comment in BasePeer).
>>
>> Mysql.log isn't showing anything interesting:
>>
>>
>> 15 Connect 061117 14:51:46 15 Prepare [1]
>> 15 Quit
>>
>> The boolean is added in populateStmtValues:
>>
>> Binding false at position 3 w/ Propel type BOOLEAN and PDO type 5
>>
>> Changing false to 0 works fine. True / 1 gives the same behaviour.
>>
>
> Could you try setting the ATTR_EMULATE_PREPARES (I forget if that's
> exactly right, but there's a comment [committed last night] to
> bookstore's runtime-conf.xml). I remember reading on Wez's blog (and
> then it was discussed on list) that there are some issues with MySQL's
> handling of prepared statements. I wonder if this is one of those ...
>
> Hans
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>
>
>
Messages per page: