Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#6 Warning from MySQL.pm

closed-fixed
Malcolm Box
7
2001-08-14
2001-05-30
Malcolm Box
No

** Warning: Issuing rollback() for database handle
being DESTROY'd without explicit disconnect() at
lib//LXR/Index/Mysql.pm line 82.

is shown when using MySQL and the ident function.

This could be something to do with the declaration of
the class variables/object variables in MySQL.pm - I'm
not convinced that the right distinction has been made.

Discussion

  • Malcolm Box
    Malcolm Box
    2001-06-19

    Logged In: YES
    user_id=215386

    Also happens with source.

    Seems to be related to the scoping of $dbh, but I can't
    figure out how.

     
  • Logged In: YES
    user_id=222743

    I had those "database handle" warnings also. I didn't cared
    about them until my work was stopped by huge memory leak in
    genxref. I added lines like following into MySql.pm where
    needed:

    $files_insert->finish;
    $files_select->finish;

    After that no more warnings and no more memory leaks.

     
  • Malcolm Box
    Malcolm Box
    2001-07-02

    Logged In: YES
    user_id=215386

    Suggestion on the mailing list from Peder:

    * Setting $dbh->trace(n) with n>0 right after you connect?

    * Explicitly qualifying $dbh with the package, ie
    s/$dbh/$LXR::Index::Mysql::dbh/ ?

    * A different version of perl?

    See
    http://www.geocrawler.com/archives/3/12478/2001/6/0/5998831/
    for details

    I haven't got round to trying this yet.

     
  • Logged In: YES
    user_id=222352

    It seems I get a similar message from the postgres backend:
    "
    disconnect(DBI::db=HASH(0x82d7b18)) invalidates 1 active
    statement. Either destroy statement handles or call finish
    on them before disconnecting. at lib//LXR/Index/Postgres.pm
    line 272.
    "

    It may very well be caused by an unfortunate ordering of END
    blocks. If the END blocks of DBI::Postgres (and MySQL) are
    called before the END blocks of LXR::Index::Postgres (and
    MySQL), the database connections would in fact be terminated
    before we have had the chance to tidy up.

    I don't know how END blocks are ordered, but I'll look into
    it.

     
  • Malcolm Box
    Malcolm Box
    2001-08-14

    • status: open --> closed-fixed
     
  • Malcolm Box
    Malcolm Box
    2001-08-14

    Logged In: YES
    user_id=215386

    Fixed by making all the database interface handles object
    member data rather than package wide.