RA Jones wrote:

Trying various places to set debugobj so far has failed with error messages, usually relating to storage. In reality I've no idea where to start with this. The intuitive place to set the debugobj is either MyApp/lib/Schema.pm or MyApp::Model::Schema.pm, but neither seems to work. Presumably I shouldn't be doing this in the MyApp/lib/Schema DBIC classes? A simple code example is really all I need to get going.

I'm still getting nowhere with this, and also found a reference on the internet to a similar problem with the Profiling section of the DBIx::Class::Manual::Cookbook. The OP did not get a definitive answer. Is it actually possible to set the debugobj, or is it urban myth?

My attempts so far:

use My::MySQL::Profiler;
__PACKAGE__->storage()->debugobj(new My::MySQL::Profiler());
__PACKAGE__->storage()->debug(1);

1) In MyApp/lib/Schema:

Couldn't instantiate component "MyApp::Model::Schema", "Cannot load schema class 'Schema': Can't call method "debugobj" on an undefined value at /home/www/apps/MyAPP/script/../lib/Schema.pm line 14. Compilation failed in require at /usr/local/share/perl/5.8.7/Catalyst/Model/DBIC/Schema.pm line 272.
 at script/myapp_server.pl line 53" at script/myapp_server.pl line 53
Compilation failed in require at script/myapp_server.pl line 53.

2) In MyApp::Model::Schema:

Can't use string ("MyApp::Model::Schema") as a HASH ref while "strict refs" in use at /usr/local/share/perl/5.8.7/Class/Accessor/Fast.pm line 38.
Compilation failed in require at (eval 98) line 3.
Compilation failed in require at script/myapp_server.pl line 53.

3) In root controller MyApp::Controller::Root:
Can't locate object method "storage" via package "MyApp::Controller::Root" at /home/www/apps/MyApp/script/../lib/MyApp/Controller/Root.pm line 16.
Compilation failed in require at (eval 171) line 3.
Compilation failed in require at script/myapp_server.pl line 53.

What am I doing wrong?
--
Richard Jones
Leeds, UK
mailto:[EMAIL PROTECTED]

_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/

Reply via email to