[Catalyst] update_or_create problem with Catalyst::Engine::Apache::MP13 and DBIC

Anthony Lincoln ahlincoln at lbl.gov
Fri May 26 16:40:59 CEST 2006

Followup: the problem stems from one of those classic Oracle-with-DBI 
not-quite-case-insensitive moments.

Such that this fails:

              my $outage = $model->update_or_create({
                  id => $id,
                  problem_ticket => $outage{problem_ticket},
                  creator => $creator,
              },{ key => 'primary' } );

but *this* works:

              my $outage = $model->update_or_create({
                  ID => $id,  #note the case difference
                  problem_ticket => $outage{problem_ticket},
                  creator => $creator,
              },{ key => 'primary' } );

I've seen this before, when using plain DBI hashrefs with columns as 
keys, but I just assumed that DBIC was immune because everything else 
works in lowercase.  It works as billed with Catalyst's standalone 
server, but with Catalyst::Engine::Apache::MP13, explicitly not loading 
Apache::DBI, it doesn't.

I wrote a DBIx::Class::Loader::Oracle based on 
DBIx::Class::Loader::Generic, and it doesn't explicitly lc() primary 
keys, so that's probably where the trouble starts.  I suppose I could do 
that to make things consistent at least.  Did I read somewhere that this 
is deprecated?

Thanks again for the help, Matt.


Anthony Lincoln wrote:
> Okay, thanks.  I'll take a second look at that and repost to the other list.
> Matt S Trout wrote:
>>Tony Lincoln wrote:
>>>I appreciate the response.  The app is mounting the same perl5 tree from
>>>an NFS-mounted filesystem, so I'm pretty sure that all the module
>>>versions are the same.  And Apache::DBI isn't loaded.  The only
>>>difference I can see is that the standalone server doesn't seem to use
>>>DBIx::Class::Storage.  I'll give the other list a try.
>>That's not actually possible; if you're talking to a database with DBIC 
>>you *always* have a DBIx::Class::Storage::DBI instance (which re-blesses 
>>itself into an appropriate subclass on first connect) since that's what 
>>creates your $dbh.
>>I'm mostly pointing at the other list because the Cat list is often 
>>high-traffic so some people who might be able to help are more likely to 
>>be reading the other one :)
>>Catalyst mailing list
>>Catalyst at lists.rawmode.org
> _______________________________________________
> Catalyst mailing list
> Catalyst at lists.rawmode.org
> http://lists.rawmode.org/mailman/listinfo/catalyst

More information about the Catalyst mailing list