FAQ
When I establish my connection to the database I want to immediately run
some SQL to initialize the databases session environment (specifically
the NLS_DATE_FORMAT for Oracle).

My question is how do I get ahold of that database handle? The
DBIx::Class::Schema->connect() makes no mention of one being available.

Steve Kirkup

Search Discussions

  • Dan Horne at Feb 12, 2008 at 7:54 pm

    Steve Kirkup said:
    When I establish my connection to the database I want to immediately run
    some SQL to initialize the databases session environment (specifically
    the NLS_DATE_FORMAT for Oracle).

    My question is how do I get ahold of that database handle? The
    DBIx::Class::Schema->connect() makes no mention of one being available.
    You shouldn't need to get hold of the handle - checkout on_connect_do:
    http://search.cpan.org/~jrobinson/DBIx-Class-0.08009/lib/DBIx/Class/Manual/Intro.pod#Connecting
  • Dagfinn Ilmari Mannsåker at Feb 12, 2008 at 8:12 pm

    Steve Kirkup writes:

    When I establish my connection to the database I want to immediately run
    some SQL to initialize the databases session environment (specifically
    the NLS_DATE_FORMAT for Oracle).
    This is exactly what the "on_connet_do" attribute to ->connect is for:

    <http://search.cpan.org/~jrobinson/DBIx-Class-0.08009/lib/DBIx/Class/Storage/DBI.pm#connect_info>
    My question is how do I get ahold of that database handle? The
    DBIx::Class::Schema->connect() makes no mention of one being available.
    You don't want to do that manually, since 1) DBIC only connects when it
    needs too and 2) it won't get rerun if DBIC has to reconnect for some
    reason.

    --
    ilmari
    "A disappointingly low fraction of the human race is,
    at any given time, on fire." - Stig Sandbeck Mathisen

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupdbix-class @
categoriesperl, catalyst
postedFeb 12, '08 at 6:03p
activeFeb 12, '08 at 8:12p
posts3
users3
websitedbix-class.org
irc#dbix-class

People

Translate

site design / logo © 2021 Grokbase