[Koha-bugs] [Bug 18286] New: Test::DBIx::Class connection/ schema is shadowed by a cached connection/schema

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Thu Mar 16 20:07:07 CET 2017


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18286

            Bug ID: 18286
           Summary: Test::DBIx::Class connection/schema is shadowed by a
                    cached connection/schema
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P5 - low
         Component: Test Suite
          Assignee: chris at bigballofwax.co.nz
          Reporter: olli-antti.kivilahti at jns.fi
        QA Contact: gmcharlt at gmail.com

If Koha::Database->schema gets called before

    use Test::DBIx::Class

The DB connection from $KOHA_CONF is cached.

This happens most of the time because when C4::Context and friends are loaded
(in compile-time?), they already access the DB.

After Test::DBIx::Class is instantiated and hooks put in place to overload
Koha::Schema connection, those hooks are never called due to getting the old
connection from cache.

This feature introduces a test case to replicate the behaviour and shows how
flushing the connection cache solves the problem.

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list