ap / DBIx-Connector

Fast, safe DBI connection and transaction management
https://metacpan.org/release/DBIx-Connector
39 stars 15 forks source link

Do not set AutoInactiveDestroy explicitly in caller #14

Closed Xiong closed 13 years ago

Xiong commented 13 years ago

It seems inadvisable to set {AutoInactiveDestroy => 1} in flags to DBIx::Connector::new(), possibly connect(). Warnings are emitted of the form:

Can't set DBI::db=HASH(0x9036450)->{AutoInactiveDestroy}: 
    unrecognised attribute name or invalid value 
    at /rad/perl/lib/cpan/DBI.pm line 708.
Can't get DBI::db=HASH(0x9036450)->{AutoInactiveDestroy}: 
    unrecognised attribute name 
    at /rad/perl/lib/cpan/DBI.pm line 708.

POD says this flag is set true by default so perhaps there is no need to set it explicitly; but nonetheless, I attempted to do so. It is not set by default in DBI (according to its POD).

XIONG (CPAN ID)

theory commented 13 years ago

Sounds like your version of the DBI does not support AutoInactiveDestroy. Note that it was added in DBI 1.614. If you have an older version of the DBI it won't work, as I think you're finding. I strongly recommend 1.614 or higher, though, if your code does any forking or threading at all.

Xiong commented 13 years ago

You know, you are right; my installed version of DBI is still 1.609. I had some trouble upgrading and I was certain I'd finally made it to 1.616 -- and 'cpan' says I have, then contradicts itself. I'll work on this, sorry.

theory commented 13 years ago

No problem. :-)