1DBIx::Class::Manual::TrUosuebrleCsohnotortiibnugt(e3d)PDeBrIlx:D:oCcluamsesn:t:aMtainounal::Troubleshooting(3)
2
3
4

NAME

6       DBIx::Class::Manual::Troubleshooting - Got a problem? Shoot it.
7
8   "Can't locate storage blabla"
9       You're trying to make a query on a non-connected schema. Make sure you
10       got the current resultset from $schema->resultset('Artist') on a schema
11       object you got back from connect().
12
13   Tracing SQL
14       The "DBIC_TRACE" environment variable controls SQL tracing, so to see
15       what is happening try
16
17         export DBIC_TRACE=1
18
19       Alternatively use the "storage->debug" class method:-
20
21         $schema->storage->debug(1);
22
23       To send the output somewhere else set debugfh:-
24
25         $schema->storage->debugfh(IO::File->new('/tmp/trace.out', 'w');
26
27       Alternatively you can do this with the environment variable, too:-
28
29         export DBIC_TRACE="1=/tmp/trace.out"
30
31   Can't locate method result_source_instance
32       For some reason the table class in question didn't load fully, so the
33       ResultSource object for it hasn't been created. Debug this class in
34       isolation, then try loading the full schema again.
35
36   Can't get last insert ID under Postgres with serial primary keys
37       Older DBI and DBD::Pg versions do not handle "last_insert_id"
38       correctly, causing code that uses auto-incrementing primary key columns
39       to fail with a message such as:
40
41         Can't get last insert id at /.../DBIx/Class/Row.pm line 95
42
43       In particular the RHEL 4 and FC3 Linux distributions both ship with
44       combinations of DBI and DBD::Pg modules that do not work correctly.
45
46       DBI version 1.50 and DBD::Pg 1.43 are known to work.
47
48   Can't locate object method "source_name" via package
49       There's likely a syntax error in the table class referred to elsewhere
50       in this error message.  In particular make sure that the package
51       declaration is correct. For example, for a schema " MySchema " you need
52       to specify a fully qualified namespace: " package MySchema::MyTable; ".
53
54   syntax error at or near "<something>" ...
55       This can happen if you have a relation whose name is a word reserved by
56       your database, e.g. "user":
57
58         package My::Schema::User;
59         ...
60         __PACKAGE__->table('users');
61         __PACKAGE__->add_columns(qw/ id name /);
62         __PACKAGE__->set_primary_key('id');
63         ...
64         1;
65
66         package My::Schema::ACL;
67         ...
68         __PACKAGE__->table('acl');
69         __PACKAGE__->add_columns(qw/ user_id /);
70         __PACKAGE__->belongs_to( 'user' => 'My::Schema::User', 'user_id' );
71         ...
72         1;
73
74         $schema->resultset('ACL')->search(
75           {},
76           {
77             join => [qw/ user /],
78             '+select' => [ 'user.name' ]
79           }
80         );
81
82       The SQL generated would resemble something like:
83
84         SELECT me.user_id, user.name FROM acl me
85         JOIN users user ON me.user_id = user.id
86
87       If, as is likely, your database treats "user" as a reserved word, you'd
88       end up with the following errors:
89
90       1) syntax error at or near "." - due to "user.name" in the SELECT
91       clause
92
93       2) syntax error at or near "user" - due to "user" in the JOIN clause
94
95       The solution is to enable quoting - see
96       "Setting_quoting_for_the_generated_SQL" in
97       DBIx::Class::Manual::Cookbook for details.
98
99   column "foo DESC" does not exist ...
100       This can happen if you are still using the obsolete order hack, and
101       also happen to turn on SQL-quoting.
102
103         $rs->search( {}, { order_by => [ 'name DESC' ] } );
104
105       Since DBIx::Class >= 0.08100 and SQL::Abstract >= 1.50 the above should
106       be written as:
107
108         $rs->search( {}, { order_by => { -desc => 'name' } } );
109
110       For more ways to express order clauses refer to "ORDER_BY_CLAUSES" in
111       SQL::Abstract
112
113   Perl Performance Issues on Red Hat Systems
114       There is a problem with slow performance of certain DBIx::Class
115       operations using the system perl on some Fedora and Red Hat Enterprise
116       Linux system (as well as their derivative distributions such as Centos,
117       White Box and Scientific Linux).
118
119       Distributions affected include Fedora 5 through to Fedora 8 and RHEL5
120       upto and including RHEL5 Update 2. Fedora 9 (which uses perl 5.10) has
121       never been affected - this is purely a perl 5.8.8 issue.
122
123       As of September 2008 the following packages are known to be fixed and
124       so free of this performance issue (this means all Fedora and RHEL5
125       systems with full current updates will not be subject to this
126       problem):-
127
128         Fedora 8     - perl-5.8.8-41.fc8
129         RHEL5        - perl-5.8.8-15.el5_2.1
130
131       This issue is due to perl doing an exhaustive search of blessed objects
132       under certain circumstances.  The problem shows up as performance
133       degradation exponential to the number of DBIx::Class row objects in
134       memory, so can be unnoticeable with certain data sets, but with huge
135       performance impacts on other datasets.
136
137       A pair of tests for susceptibility to the issue and performance effects
138       of the bless/overload problem can be found in the DBIx::Class test
139       suite, in the "t/99rh_perl_perf_bug.t" file.
140
141       Further information on this issue can be found in
142       <https://bugzilla.redhat.com/show_bug.cgi?id=379791>,
143       <https://bugzilla.redhat.com/show_bug.cgi?id=460308> and
144       http://rhn.redhat.com/errata/RHBA-2008-0876.html
145       <http://rhn.redhat.com/errata/RHBA-2008-0876.html>
146
147   Excessive Memory Allocation with TEXT/BLOB/etc. Columns and Large
148       LongReadLen
149       It has been observed, using DBD::ODBC, that creating a DBIx::Class::Row
150       object which includes a column of data type TEXT/BLOB/etc. will
151       allocate LongReadLen bytes.  This allocation does not leak, but if
152       LongReadLen is large in size, and many such row objects are created,
153       e.g. as the output of a ResultSet query, the memory footprint of the
154       Perl interpreter can grow very large.
155
156       The solution is to use the smallest practical value for LongReadLen.
157
158
159
160perl v5.12.0                      2010-0D5B-I1x2::Class::Manual::Troubleshooting(3)
Impressum