Re: [CDBI] Re: Deep recursion
Matt S Trout <dbix-class-uY5y5/[email protected]> Fri, 17 Aug 2007 10:22:52 +0100
| Newsgroups | gmane.comp.lang.perl.modules.class-dbi |
|---|---|
| Message-ID | <[email protected]> |
On Thu, Aug 16, 2007 at 06:13:00PM -0700, Arshavir Grigorian wrote:
> Edward,
>
> Thanks for the comments. You were right, it didn't have anything to do
> with naming.
>
> After a lot of looking, I found the problem. In my code
>
> foreach my $column (keys %$href) {
> $obj->set($column => $href->{$column});
> }
>
> among others, I also had an 'id' key in the $href hash (for later use)
> and was effectively setting/updating the primary key of the table.
> Removing that key fixed the issue. I can't think of any instances
> where it would be necessary to modify a primary key, but with that
> being said, there should definitely be an error/warning message
> generated when someone tries to do that.
Or somebody could try and backport the DBIx::Class code that makes updating
a primary key actually work.
You could probably get it for free by switching to CDBICompat now Schwern's
got that sorted out.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director Want a managed development or deployment platform?
Shadowcat Systems Ltd. Contact mst (at) shadowcatsystems.co.uk for a quote
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/