Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Propel::close() does not close connections when using propel debug #312

Open
OneHourTranslation opened this Issue Mar 11, 2012 · 6 comments

Comments

Projects
None yet
5 participants
@ghost

ghost commented Mar 11, 2012

When opening a connection and specifying debug mode with:

$conn->useDebug(true);

Propel::close() does not close this connection.

A workaround is to disable debugging right before closing the connection, like this:

$conn->useDebug(false);
Propel::close();
Member

fzaninotto commented Mar 19, 2012

Do you have a unit test that can prove the issue? I never had trouble with connections left open in debug mode.

@ghost

ghost commented Apr 24, 2012

Not a formal unit test, but should do the trick...
Notice that on my setup, I use the master-slave configuration, it that's even relevant.

<?php

//Set those paths to the correct files
$propel_path = 'path/to/Propel/runtime/lib/Propel.php' ; 
$propel_conf_path = 'path/to/PropelBuild/build/conf/conf.php';

//Play with this variable to see the magic
$debug = true;

require_once $propel_path;



for($i=0;$i<10;$i++){
    connect();
    $conn = Propel::getConnection('default', Propel::CONNECTION_WRITE);

    /* @var $res PDOStatement */
    $res = $conn->query('SHOW PROCESSLIST');
    printf("# Processes: %d<br />",$res->rowCount());

    disconnect();
}

function connect(){
    global $propel_conf_path,$debug;
    Propel::init($propel_conf_path);
    $conn = Propel::getConnection('default', Propel::CONNECTION_WRITE);
    $conn->useDebug($debug);

}

function disconnect(){
    Propel::close();
}

Hi,I am using propel PHP: The foreign key attries are not getting depended on the parent table. The Creations, updates, deletes are taken place in parent is not effecting the child table.

foreign-key elements like onupdate,ondelete,skipsql is not acceping by the propel and error's like this

DOMDocument::schemaValidate(): Element 'foreign-key', attribute 'ondelete','onupdate','skipsql' The attribute is not allowing ?

Can any one of the help me.??

Member

jaugustin commented Jan 20, 2013

@kirankotari could you open a new issue if you have an issue with Propel, otherwise if you need help on how to use thing look at the documentation http://propelorm.org/ or http://propelorm.org/support.html for support.

I think your xml is malformed look here http://propelorm.org/reference/schema.html#foreignkey_element

Yes, I got it (spelling mistakes on xml file). thank u "jaugustin"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment