Re: Object Index

[prev] [thread] [next] [Date index for 2005/04/19]

From: Perrin Harkins
Subject: Re: Object Index
Date: 03:19 on 19 Apr 2005
On Tue, 2005-04-19 at 10:19 +1000, Jason Galea wrote:
> If you create an object (which has an auto_increment id), then retrieve 
> another copy of that object and change a field value, your original 
> object won't get the changes.
> 
> I think what is happening is that the object index won't index the newly 
> created item as it doesn't have it's id. When the copy is retrieved it 
> is indexed but the original object has no connection to the indexed object.

That's all correct.

> Modifying the _create method in Class/DBI.pm to call _init before 
> returning appears to fix the problem but I can't see it being the best 
> solution.

Call it a second time you mean?  A better solution would be to create an
"add_to_object_index()" method and call that after the primary key is
filled in.  I'll see if I can add this to Tim Bunce's patch that I'm
messing with right now.

- Perrin

Object Index
Jason Galea 00:19 on 19 Apr 2005

ContextualFetch 1.02 steps on $DBI::errstr
Rod McChesney 02:40 on 19 Apr 2005

Re: Object Index
Perrin Harkins 03:19 on 19 Apr 2005

Re: Object Index
Jason Galea 07:02 on 19 Apr 2005

Generated at 09:29 on 27 Apr 2005 by mariachi v0.52