Re: [CDBI] uniqueness of objects in memory??

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

From: Phil Mitchell
Subject: Re: [CDBI] uniqueness of objects in memory??
Date: 17:42 on 24 Oct 2005
On 10/24/05, Perrin Harkins <perrin@xxxx.xxx> wrote:
> On Sun, 2005-10-23 at 20:32 -0700, Phil Mitchell wrote:
> > 1. User has_a Prefs object; User->Prefs->home_page equals X
> > 2. Prefs gets updated with new data; Prefs->home_page equals Y
> > 3. But User->Prefs->home_page still equals X.
>
> Here are some possible reasons:
> 1. You are using an older Class::DBI that doesn't support this feature
> but looking at docs for a later version.

=3D=3DI'm on 3.0.1

> 2. Your Perl doesn't support weak references.  I think the docs explain
> how to check this.

=3D=3DIt does ... perl -e 'use Scalar::Util qw(weaken)'

> 3. Your primary key for this class is defined incorrectly, so these
> objects do not appear the same to Class::DBI.

Not sure, but my usage is pretty simple:
__PACKAGE__->columns(Primary =3D> qw/id /);

> 4. Something in the particular sequence of actions you're doing has
> uncovered a bug.  In that case, simmering it down to a small test case,
> would make it easier for people to help you with it.

I am surprised to find that I can rip out all the relationships
(except has_a(Prefs) of course) and triggers and still get this
result. Here's the boiled-down CDBI portions of my three classes:
User, Prefs, and Page -- User and Prefs are both subclasses of Page.

-------------------------------------------------------------
package Reef::M::DBI::Page;
use base 'Reef::M::DBI';

__PACKAGE__->table('page');
__PACKAGE__->columns(Primary =3D> qw/id /);
__PACKAGE__->columns(Essential =3D> qw/page_type
                                     created
                                     edit_date
                                     edit_by
                                     user_owner
                                     club_owner
                                     permissions
                                     locked_since
                                     locked_by
                                     title
                                     body
                                     home_page
                                     username
                                     password
                                     prefs
                                     shelf
                                    /);

----------------------------------------------------------
package Reef::M::DBI::Page::User;
use base 'Reef::M::DBI::Page';

__PACKAGE__->has_a(prefs =3D> 'Reef::M::DBI::Page::Prefs');

-----------------------------------------------------------
package Reef::M::DBI::Page::Prefs;
use base 'Reef::M::DBI::Page';

-----------------------------------------------------------

Thanks for your help!

>
> - Perrin
>
>


--
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D
2People Blog: http://2-people.blogspot.com/
2People site: http://www.2people.org

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

(message missing)

[CDBI] uniqueness of objects in memory??
Phil Mitchell 03:32 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Perrin Harkins 16:12 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Phil Mitchell 17:42 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Perrin Harkins 18:41 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Christopher H. Laco 18:53 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Phil Mitchell 19:43 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
William Ross 19:50 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Phil Mitchell 19:35 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Perrin Harkins 19:52 on 24 Oct 2005

[CDBI] Re: uniqueness of objects in memory??
Edward J. Sabol 19:47 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Perrin Harkins 19:54 on 24 Oct 2005

[CDBI] Re: uniqueness of objects in memory??
Edward J. Sabol 20:03 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 20:18 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Christopher H. Laco 19:46 on 24 Oct 2005

Re: [CDBI] uniqueness of objects in memory??
Christopher H. Laco 19:56 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Michael Peters 20:23 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 20:31 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Bill Moseley 20:46 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 21:30 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 22:07 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Perrin Harkins 22:13 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 23:34 on 24 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Rod McChesney 03:15 on 25 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 03:48 on 25 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Perrin Harkins 04:18 on 25 Oct 2005

Re: [CDBI] Re: uniqueness of objects in memory??
Phil Mitchell 06:08 on 25 Oct 2005

Generated at 14:18 on 27 Oct 2005 by mariachi v0.52