FAQ
Hi

It seems that the Storage::DBI::ODBC module causes DBI->connect() to be called twice when you connect to the database.

I have posted this as a possible bug in CPAN RT. The bug report with more information can be found here: http://rt.cpan.org/Public/Bug/Display.html?id=38186

The bug *seems* to be easy to fix, but feedback from others using the Storage::DBI::ODBC module would be useful.

Regards
Øystein Torget (oyse)
**************************************************************
The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
**************************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20080811/9792863a/attachment.htm

Search Discussions

  • Marc Mims at Aug 11, 2008 at 5:10 pm

    * Oystein.Torget@dnv.com [080811 08:40]:
    It seems that the Storage::DBI::ODBC module causes DBI->connect() to
    be called twice when you connect to the database.

    I have posted this as a possible bug in CPAN RT. The bug report with
    more information can be found here:
    http://rt.cpan.org/Public/Bug/Display.html?id8186

    The bug *seems* to be easy to fix, but feedback from others using the
    Storage::DBI::ODBC module would be useful.
    Looks we're recursing and $self->_dbh, rather than $self->dbh would,
    indeed, solve the problem. However, I wonder if we should be using the
    newer $self->dbh_do, instead?

    -Marc
  • Oystein Torget at Aug 11, 2008 at 6:43 pm

    -----Original Message-----
    From: Marc Mims
    Sent: 11. august 2008 18:10
    To: dbix-class@lists.scsys.co.uk
    Subject: Re: [Dbix-class] Storage::DBI::ODBC cause
    DBI->connect() to becalled twice

    * Oystein.Torget@dnv.com [080811 08:40]:
    It seems that the Storage::DBI::ODBC module causes DBI->connect() to
    be called twice when you connect to the database.

    I have posted this as a possible bug in CPAN RT. The bug report with
    more information can be found here:
    http://rt.cpan.org/Public/Bug/Display.html?id8186

    The bug *seems* to be easy to fix, but feedback from others using the
    Storage::DBI::ODBC module would be useful.
    Looks we're recursing and $self->_dbh, rather than $self->dbh would,
    indeed, solve the problem. However, I wonder if we should be
    using the
    newer $self->dbh_do, instead?

    -Marc
    I am not sure if I understand what you suggest, but I tried replacing the two following lines

    my $dbh = $self->dbh;
    my $dbtype = eval { $dbh->get_info(17) };

    with

    my $dbtype = $self->dbh_do( sub { my ( $storage, $dbh ) = @_; $dbh->get_info(17) } );

    Doing so still causes two calls to DBI->connect() and gives the same problem with database locks not being released. The reason that connect() gets called two times is that _conn_pid has not been set when _rebless() calls dbh_do() so _verify_pid() clears _dbh and _populate_dbh gets called a second time.

    Setting $self->_conn_pid before the call to _rebless() will make using dbh_do() work correctly in _rebless(), but I don't know if that is something that is ok to do.

    - oyse


    **************************************************************
    The contents of this e-mail message and any attachments are confidential and are intended solely for the addressee. If you have received this transmission in error, please immediately notify the sender by return e-mail and delete this message and its attachments. Any unauthorized use, copying or dissemination of this transmission is prohibited. Neither the confidentiality nor the integrity of this message can be vouched for following transmission on the Internet.
    **************************************************************
  • Marc Mims at Aug 12, 2008 at 6:43 pm

    * Oystein.Torget@dnv.com [080811 08:40]:
    It seems that the Storage::DBI::ODBC module causes DBI->connect() to
    be called twice when you connect to the database.

    I have posted this as a possible bug in CPAN RT. The bug report with
    more information can be found here:
    http://rt.cpan.org/Public/Bug/Display.html?id8186

    The bug *seems* to be easy to fix, but feedback from others using the
    Storage::DBI::ODBC module would be useful.
    I applied your suggested fix (using _dbh instead of dbh).
    http://dev.catalyst.perl.org/svnweb/bast/revision?revG50

    Please retest using trunk and let me know if you find any problems.

    -Marc

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbix-class @
categoriesperl, catalyst
postedAug 11, '08 at 4:34p
activeAug 12, '08 at 6:43p
posts4
users2
websitedbix-class.org
irc#dbix-class

2 users in discussion

Oystein Torget: 2 posts Marc Mims: 2 posts

People

Translate

site design / logo © 2021 Grokbase