FAQ
Hey:

       I was working on persistent PDO supports in phpng..

       and you may already know this odds behavior:

  <?php
class Foo extends PDO {
}

class Baz extends PDO {
}

$bar = new Foo("sqlite::memory:", null, null,
array(PDO::ATTR_PERSISTENT => true));
$baz = new Baz("sqlite::memory:", null, null,
array(PDO::ATTR_PERSISTENT => true));
var_dump($bar);
var_dump($baz);

?>

    it output :

object(Foo)#1 (0) {
}
object(Foo)#2 (0) {
}


      which seems very odds for me...

     anyway after the new implementation. this has been fixed , in
phpng it outputs:

object(Foo)#1 (0) {
}
object(Baz)#2 (0) {
}

      I am just not sure, is the previous behavior is on purpose? or
any other reasons?

     if no. then I will leave the current fix as it is...


thanks
--
Laruence Xinchen Hui
http://www.laruence.com/

Search Discussions

  • Michael Wallner at May 26, 2014 at 6:59 am

    On 26 May 2014 08:34, Laruence wrote:

    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?

    if no. then I will leave the current fix as it is...
    See here f.e. https://bugs.php.net/bug.php?id=47407


    --
    Regards,
    Mike
  • Laruence at May 26, 2014 at 8:13 am

    On Mon, May 26, 2014 at 2:59 PM, Michael Wallner wrote:
    On 26 May 2014 08:34, Laruence wrote:

    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?

    if no. then I will leave the current fix as it is...
    See here f.e. https://bugs.php.net/bug.php?id=47407
    Hmm, from what I see, that implies it is a bug? (I also think it's a
    bug anyway)

    thanks
    --
    Regards,
    Mike


    --
    Laruence Xinchen Hui
    http://www.laruence.com/
  • Michael Wallner at May 26, 2014 at 8:14 am

    On 26 May 2014 10:13, Laruence wrote:
    On Mon, May 26, 2014 at 2:59 PM, Michael Wallner wrote:
    On 26 May 2014 08:34, Laruence wrote:

    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?

    if no. then I will leave the current fix as it is...
    See here f.e. https://bugs.php.net/bug.php?id=47407
    Hmm, from what I see, that implies it is a bug? (I also think it's a
    bug anyway)
    Yes, I'd definitely see it as bug, too.

    --
    Regards,
    Mike
  • Stas Malyshev at May 26, 2014 at 9:20 pm
    Hi!
    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?
    No, I don't think it's on purpose, it looks like a bug.

    --
    Stanislav Malyshev, Software Architect
    SugarCRM: http://www.sugarcrm.com/
    (408)454-6900 ext. 227
  • Laruence at May 27, 2014 at 3:44 am

    On Tue, May 27, 2014 at 5:20 AM, Stas Malyshev wrote:
    Hi!
    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?
    No, I don't think it's on purpose, it looks like a bug.
    Okey, then I am going to fix the tests (only in phpng)

    thanks
    --
    Stanislav Malyshev, Software Architect
    SugarCRM: http://www.sugarcrm.com/
    (408)454-6900 ext. 227


    --
    Laruence Xinchen Hui
    http://www.laruence.com/
  • Pierre Joye at May 27, 2014 at 5:14 am

    On May 27, 2014 5:45 AM, "Laruence" wrote:
    On Tue, May 27, 2014 at 5:20 AM, Stas Malyshev wrote:
    Hi!
    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?
    No, I don't think it's on purpose, it looks like a bug.
    Okey, then I am going to fix the tests (only in phpng)
    Hm... Well... Not too good. But at least use the bug # in the commit
    message.

    Cheers,
    Pierre
  • Lester Caine at May 27, 2014 at 5:44 am

    On 26/05/14 22:20, Stas Malyshev wrote:
    I am just not sure, is the previous behavior is on purpose? or
    any other reasons?
    No, I don't think it's on purpose, it looks like a bug.
    PDO has a few simple assumptions, such as only allowing one connection
    per transaction, which is fine for most engines, but Firebird/Interbase
    has a very useful cross database transaction mechanism which PDO can not
    support. Persistent connections are another are where it's how the
    engine implements this which is the 'problem' as much as what PDO does.
    What 'persist' says is basically say 'use an existing connection' so how
    does sqlite actually support connection pooling? A quick scan of the
    sqlite manual would suggest that it requires fully thread safe operation
    to do that, and that you need a later version of sqlite. So is this an
    engine specific problem or a problem with the way PDO tries to simplify
    the connection model?

    --
    Lester Caine - G8HFL
    -----------------------------
    Contact - http://lsces.co.uk/wiki/?page=contact
    L.S.Caine Electronic Services - http://lsces.co.uk
    EnquirySolve - http://enquirysolve.com/
    Model Engineers Digital Workshop - http://medw.co.uk
    Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupphp-internals @
categoriesphp
postedMay 26, '14 at 6:34a
activeMay 27, '14 at 5:44a
posts8
users5
websitephp.net

People

Translate

site design / logo © 2022 Grokbase