1DBIx::Class::Manual::TrUosuebrleCsohnotortiibnugt(e3d)PDeBrIlx:D:oCcluamsesn:t:aMtainounal::Troubleshooting(3)
2
3
4
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 "Setting quoting for the
96 generated SQL" in DBIx::Class::Manual::Cookbook for details.
97
98 column "foo DESC" does not exist ...
99 This can happen if you are still using the obsolete order hack, and
100 also happen to turn on SQL-quoting.
101
102 $rs->search( {}, { order_by => [ 'name DESC' ] } );
103
104 Since DBIx::Class >= 0.08100 and SQL::Abstract >= 1.50 the above should
105 be written as:
106
107 $rs->search( {}, { order_by => { -desc => 'name' } } );
108
109 For more ways to express order clauses refer to "ORDER BY CLAUSES" in
110 SQL::Abstract
111
112 Perl Performance Issues on Red Hat Systems
113 There is a problem with slow performance of certain DBIx::Class
114 operations using the system perl on some Fedora and Red Hat Enterprise
115 Linux system (as well as their derivative distributions such as Centos,
116 White Box and Scientific Linux).
117
118 Distributions affected include Fedora 5 through to Fedora 8 and RHEL5
119 up to and including RHEL5 Update 2. Fedora 9 (which uses perl 5.10) has
120 never been affected - this is purely a perl 5.8.8 issue.
121
122 As of September 2008 the following packages are known to be fixed and
123 so free of this performance issue (this means all Fedora and RHEL5
124 systems with full current updates will not be subject to this
125 problem):-
126
127 Fedora 8 - perl-5.8.8-41.fc8
128 RHEL5 - perl-5.8.8-15.el5_2.1
129
130 This issue is due to perl doing an exhaustive search of blessed objects
131 under certain circumstances. The problem shows up as performance
132 degradation exponential to the number of DBIx::Class result objects in
133 memory, so can be unnoticeable with certain data sets, but with huge
134 performance impacts on other datasets.
135
136 A pair of tests for susceptibility to the issue and performance effects
137 of the bless/overload problem can be found in the DBIx::Class test
138 suite, in the "t/99rh_perl_perf_bug.t" file.
139
140 Further information on this issue can be found in
141 <https://bugzilla.redhat.com/show_bug.cgi?id=379791>,
142 <https://bugzilla.redhat.com/show_bug.cgi?id=460308> and
143 <http://rhn.redhat.com/errata/RHBA-2008-0876.html>
144
145 Excessive Memory Allocation with TEXT/BLOB/etc. Columns and Large
146 LongReadLen
147 It has been observed, using DBD::ODBC, that creating a DBIx::Class::Row
148 object which includes a column of data type TEXT/BLOB/etc. will
149 allocate LongReadLen bytes. This allocation does not leak, but if
150 LongReadLen is large in size, and many such result objects are created,
151 e.g. as the output of a ResultSet query, the memory footprint of the
152 Perl interpreter can grow very large.
153
154 The solution is to use the smallest practical value for LongReadLen.
155
157 Check the list of additional DBIC resources.
158
160 This module is free software copyright by the DBIx::Class (DBIC)
161 authors. You can redistribute it and/or modify it under the same terms
162 as the DBIx::Class library.
163
164
165
166perl v5.28.0 2017-1D2B-I0x8::Class::Manual::Troubleshooting(3)