[CDBI] Bug with sequences and the object cache ( I think )

Edmund von der Burg edmund.vonderburg at gmail.com
Thu Nov 10 09:53:36 GMT 2005


On 09/11/05, Perrin Harkins <perrin at elem.com> wrote:
> I provided a patch against Class::DBI 0.96 that fixed this, along with
> other object index issues, back in June.  It looks like it did not get
> put in.
>
> This will not work against newer versions (or without the rest of the
> changes in the patch), but here's the relevant portion if you want to
> adjust it for the version you use:
>
> @@ -569,6 +617,12 @@
>         my @discard_columns = grep !exists $primary_columns{$_}, keys %
> $real;
>         $self->call_trigger('create', discard_columns =>
> \@discard_columns);   # XXX
>
> +       # now that we have a complete primary key, add this to the
> object index
> +       if ($Use_Object_Index) {
> +               my $key = $class->_live_object_key({ $self->_as_hash });
> +               $class->live_object_store($self, $key);
> +       }
> +
>         # Empty everything back out again!
>         $self->_attribute_delete(@discard_columns);
>         $self->call_trigger('after_create');

Just a couple of small tweaks and this can be added to v3.0.12 leading
to the test suite I posted passing (as well as the other tests):

        # now that we have a complete primary key, add this to the
        # object index
        if ( $Weaken_Is_Available ) {
          $self = $class->_init( $self );
        }

I occurs to me that the tests that I included in the first email in
this thread could be included with CDBI if it used the database
'Template1' and created temporary tables and the dbi_commit bits were
removed. People might ot take well to template1 being mucked around
with though...

Thanks for you help.
  Edmund.

--
In reality I'm evdb at ecclestoad.co.uk - http://ecclestoad.co.uk




More information about the ClassDBI mailing list