Re: Getting hold of newly created objects

[prev] [thread] [next] [Date index for 2005/07/01]

From: William Ross
Subject: Re: Getting hold of newly created objects
Date: 12:13 on 01 Jul 2005
On 1 Jul 2005, at 12:19, David Baird wrote:

> I'm wondering if I've got the wrong end of the stick here and I'm  
> just being stupid. I need to create new objects and then work with  
> them.

i have to ask: what's wrong with

     my $thing = $class->create({...});        ?

> After creating the object, CDBI throws away all the object's data.

...in order to force a reload after triggers have been triggered,  
since the data may have changed. It goes back to the database on the  
first column call.

> The primary key is an auto-increment column in MySQL - and the  
> newly created object does not include its primary key value.

That's weird, and probably evidence of a deeper illness. It should  
definitely (and only) contain its pk when it comes back from _create.  
Are there any triggers involved?

will

Getting hold of newly created objects
David Baird 11:19 on 01 Jul 2005

Re: Getting hold of newly created objects
William Ross 12:13 on 01 Jul 2005

Re: Getting hold of newly created objects
Tony Bowden 12:27 on 01 Jul 2005

Re: Getting hold of newly created objects
David Baird 12:38 on 01 Jul 2005

Generated at 16:36 on 28 Jul 2005 by mariachi v0.52