From: Chris W. <ch...@cw...> - 2003-03-31 15:16:49
|
(cc'd to oi-dev) damien leri wrote: > on a table using an multifield object_id, there's trouble with > object_keys table, as shown in my log here. Should the value > for the object_id column be '8,1' or what? I'm pretty sure it should. I actually haven't used any with objects in OI, which is why I never ran into this problem. > quite possibly i've fouled up my spops conf for this class? i > could add an auto_increment field and make the current pkey > merely a unique one, if you think that would boost performance > or stability... i expect less than a few thousand records in > this table. the spops is at the end of this email. No, your SPOPS configuration is right. The problem is with something OI is trying to do: create an index of all objects so it can normalize the keys. so instead of having a 'class/object_id' in every table you just have an 'object_key', a 32-character MD5 checksum. I'm probably going to get rid of this in the next version, or at least make it more integrated. In any case, the fix will be in the next version. The problem is this in OI::SPOPS line 102: my $row = $self->db_select( { %{ $p }, from => OBJECT_KEY_TABLE, select => [ 'object_key' ], where => 'class = ? AND object_id = ?', value => [ ref $self, $self->id ], return => 'single' }); See, $self->id is in list context, which means it returns a list of your multiple keys rather than concatenating them. Easy to fix: just change it to 'scalar( $self->id )' and it should work. You can get around it now by using a surrogate primary key (auto-increment, which I generally recommend anyway) or by adding 'skip_object_key => 1' to your SPOPS configuration. Later, Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988. |