From e5a7b0ec8d30b0df90c5a5b45720245045486d54 Mon Sep 17 00:00:00 2001 From: miker Date: Fri, 19 Mar 2010 20:58:14 +0000 Subject: [PATCH] pull the query parser implementation in at startup git-svn-id: svn://svn.open-ils.org/ILS/trunk@15919 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Storage.pm | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm index 65f95c9fe4..b57a71820e 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Storage.pm @@ -13,6 +13,7 @@ use OpenILS::Application::Storage::FTS; # the easy way to get to the logger... my $log = "OpenSRF::Utils::Logger"; +our $QParser; our $WRITE = 0; our $IGNORE_XACT_ID_FAILURE = 0; @@ -24,9 +25,8 @@ sub initialize { $log->debug('Initializing ' . __PACKAGE__ . '...', DEBUG); - my $driver = "OpenILS::Application::Storage::Driver::". - $conf->config_value( apps => 'open-ils.storage' => app_settings => databases => 'driver'); - + my $db_driver = $conf->config_value( apps => 'open-ils.storage' => app_settings => databases => 'driver'); + my $driver = "OpenILS::Application::Storage::Driver::$db_driver"; $log->debug("Attempting to load $driver ...", DEBUG); @@ -64,7 +64,17 @@ sub child_init { if (OpenILS::Application::Storage::CDBI->db_Main()) { $log->debug("Success initializing driver!", DEBUG); - return 1; + + my $db_driver = $conf->config_value( apps => 'open-ils.storage' => app_settings => databases => 'driver'); + $QParser = 'OpenILS::Application::Storage::Driver::'.$db_driver.'::QueryParser'; + $QParser->use; + + if($@) { + $log->debug( "Can't load $QParser! : $@", ERROR ); + $log->error( "Can't load $QParser! : $@"); + } else { + return 1; + } } $log->debug("FAILURE initializing driver!", ERROR); -- 2.11.0