[Dbix-class] last insert id problem with Oracle

Tony Lincoln AHLincoln at lbl.gov
Tue Jul 11 18:29:32 CEST 2006



----- Original Message -----
From: Jess Robinson <castaway at desert-island.demon.co.uk>
Date: Tuesday, July 11, 2006 0:00 am
Subject: Re: [Dbix-class] last insert id problem with Oracle

> 
> 
> 
> On Mon, 10 Jul 2006, Anthony Lincoln wrote:
> 
> > package ccm::Model::CCMData::Issweb::CcmChange;
> >
> > use strict;
> > use warnings;
> > use base 'DBIx::Class::Core';
> >
> > __PACKAGE__->load_components(qw/PK::Auto Core/);
> > __PACKAGE__->table('ccm_change');
> > __PACKAGE__->add_columns(qw/id owner name prereq_id dependent 
> description>                          backout_plan visibility risk 
> sys_criticality>                          sys_affected 
> qa_difficulty install_difficulty
> >                          problem_visibility completed creator 
> created/);> __PACKAGE__->set_primary_key('id');
> > __PACKAGE__->sequence('ccm_seq');
> 
> You have your id field as "id" there, yet your update_or_create has 
> it as 
> "ID". We're storing things in hashrefs, where things are case-
> senstive, 
> and PK::Auto doesnt compare things lower-casedly.. So maybe thats 
> your 
> problem?
> 

Well, I had changed the id field's case in update_or_create because
PK::Auto wouldn't increment it when it was lowercased, and I had sort of
chalked that up to the hashref case-sensitivity (I've had the same issue
with plain old DBI hashrefs), but I didn't think of the conflict you
just outlined.  Let me take a look at that and get back to you all.

Thanks!

-Tony




More information about the Dbix-class mailing list