Commit | Line | Data |
3b44ccc6 |
1 | =head1 NAME |
2 | |
3 | DBIx::Class::Manual::Troubleshooting - Got a problem? Shoot it. |
ee38fa40 |
4 | |
130c6439 |
5 | =head2 "Can't locate storage blabla" |
ee38fa40 |
6 | |
01afee83 |
7 | You're trying to make a query on a non-connected schema. Make sure you got |
8 | the current resultset from $schema->resultset('Artist') on a schema object |
9 | you got back from connect(). |
10 | |
159a8515 |
11 | =head2 Tracing SQL |
12 | |
6fe735fa |
13 | The C<DBIC_TRACE> environment variable controls |
159a8515 |
14 | SQL tracing, so to see what is happening try |
15 | |
6fe735fa |
16 | export DBIC_TRACE=1 |
159a8515 |
17 | |
1780ac9b |
18 | Alternatively use the C<< storage->debug >> class method:- |
159a8515 |
19 | |
20 | $class->storage->debug(1); |
21 | |
92b858c9 |
22 | To send the output somewhere else set debugfh:- |
23 | |
24 | $class->storage->debugfh(IO::File->new('/tmp/trace.out', 'w'); |
25 | |
26 | Alternatively you can do this with the environment variable too:- |
27 | |
6fe735fa |
28 | export DBIC_TRACE="1=/tmp/trace.out" |
159a8515 |
29 | |
01afee83 |
30 | =head2 Can't locate method result_source_instance |
31 | |
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 | =head2 Can't get last insert ID under Postgres with serial primary keys |
37 | |
38 | Older L<DBI> and L<DBD::Pg> versions do not handle C<last_insert_id> |
39 | correctly, causing code that uses auto-incrementing primary key |
40 | columns to fail with a message such as: |
41 | |
42 | Can't get last insert id at /.../DBIx/Class/Row.pm line 95 |
43 | |
44 | In particular the RHEL 4 and FC3 Linux distributions both ship with |
45 | combinations of L<DBI> and L<DBD::Pg> modules that do not work |
46 | correctly. |
47 | |
48 | L<DBI> version 1.50 and L<DBD::Pg> 1.43 are known to work. |
49 | |
38c07935 |
50 | =head2 ... Can't locate object method "source_name" via package ... |
51 | |
52 | There's likely a syntax error in the table class referred to elsewhere |
53 | in this error message. In particular make sure that the package |
54 | declaration is correct, so for a schema C< MySchema > you need to |
55 | specify a fully qualified namespace: C< package MySchema::MyTable; > |
56 | for example. |
57 | |
ee38fa40 |
58 | =cut |
59 | |