More descriptive error messages courtesy of Marc Espie
[dbsrgits/DBIx-Class-Historic.git] / lib / DBIx / Class / Manual / Troubleshooting.pod
CommitLineData
3b44ccc6 1=head1 NAME
2
3DBIx::Class::Manual::Troubleshooting - Got a problem? Shoot it.
ee38fa40 4
130c6439 5=head2 "Can't locate storage blabla"
ee38fa40 6
01afee83 7You're trying to make a query on a non-connected schema. Make sure you got
8the current resultset from $schema->resultset('Artist') on a schema object
9you got back from connect().
10
159a8515 11=head2 Tracing SQL
12
6fe735fa 13The C<DBIC_TRACE> environment variable controls
159a8515 14SQL tracing, so to see what is happening try
15
6fe735fa 16 export DBIC_TRACE=1
159a8515 17
1780ac9b 18Alternatively use the C<< storage->debug >> class method:-
159a8515 19
20 $class->storage->debug(1);
21
92b858c9 22To send the output somewhere else set debugfh:-
23
24 $class->storage->debugfh(IO::File->new('/tmp/trace.out', 'w');
25
26Alternatively 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
32For some reason the table class in question didn't load fully, so the
33ResultSource object for it hasn't been created. Debug this class in
34isolation, then try loading the full schema again.
35
36=head2 Can't get last insert ID under Postgres with serial primary keys
37
38Older L<DBI> and L<DBD::Pg> versions do not handle C<last_insert_id>
39correctly, causing code that uses auto-incrementing primary key
40columns to fail with a message such as:
41
42 Can't get last insert id at /.../DBIx/Class/Row.pm line 95
43
44In particular the RHEL 4 and FC3 Linux distributions both ship with
45combinations of L<DBI> and L<DBD::Pg> modules that do not work
46correctly.
47
48L<DBI> version 1.50 and L<DBD::Pg> 1.43 are known to work.
49
ee38fa40 50=cut
51