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

[prev] [thread] [next] [Date index for 2005/11/10]

From: Edmund von der Burg
Subject: Re: [CDBI] Bug with sequences and the object cache ( I think )
Date: 09:53 on 10 Nov 2005
On 09/11/05, Perrin Harkins <perrin@xxxx.xxx> 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 =3D grep !exists $primary_columns{$_}, keys %
> $real;
>         $self->call_trigger('create', discard_columns =3D>
> \@discard_columns);   # XXX
>
> +       # now that we have a complete primary key, add this to the
> object index
> +       if ($Use_Object_Index) {
> +               my $key =3D $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 =3D $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@xxxxxxxxxx.xx.xx - http://ecclestoad.co.uk

_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Bug with sequences and the object cache ( I think )
Edmund von der Burg 17:06 on 09 Nov 2005

Re: [CDBI] Bug with sequences and the object cache ( I think )
Edmund von der Burg 09:53 on 10 Nov 2005

Generated at 18:17 on 10 Nov 2005 by mariachi v0.52