[CDBI] TEMP columns not persisting through $self->add_to_<something>s

Berg, Eric eric.berg at lehman.com
Tue May 15 02:36:10 BST 2007

 Not quite.  Sorry if I wasn't clear.

I have a method in my Test object that loads some data to create the
Actions using $test->add_to_actions().  It's called as
$test->load_action_defs(). In that method the actions have their TEMP
column values, but when I look at the Actions after that runs, the
actions are populated only with their id's.

I do run an after_create trigger on the actions that sets another TEMP
column value, which might have implications that I'm not aware of.

But basically, I call the method that does the add_to_actions(), and
when I return from that method, the temp columns in the Action objects
that I get with $test->actions have only the Primary column.

I hope that's more clear.


-----Original Message-----
From: pharkins at gmail.com [mailto:pharkins at gmail.com] On Behalf Of Perrin
Sent: Monday, May 14, 2007 7:40 PM
To: Berg, Eric
Cc: classdbi at svr02.digitalcraftsmen.net
Subject: Re: [CDBI] TEMP columns not persisting through

On 5/14/07, Berg, Eric <eric.berg at lehman.com> wrote:
> Test->has_many(actions => 'Action');
> $action = $test->add_to_actions($action_parameters);
> Now, at this point, the $action object is in tact, but when I return 
> from the method (a method of Test, btw) that does the 
> add_to_actions(), the actions are empty, so we'd have to go back to 
> the db to get the data...only it's not in there, because they're temp
> Why do my TEMP columns disappear in the middle of the execution of a 
> program?

Not sure I'm following.  Are you saying that you don't return the
actions you created here, but then you fetch them from the db somewhere
else and they don't contain the temp data?  Temp columns are not saved
at all.  They only keep their value until the object goes out of scope.

- Perrin

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

This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.

IRS Circular 230 Disclosure:
Please be advised that any discussion of U.S. tax matters contained within this communication (including any attachments) is not intended or written to be used and cannot be used for the purpose of (i) avoiding U.S. tax related penalties or (ii) promoting, marketing or recommending to another party any transaction or matter addressed herein.

More information about the ClassDBI mailing list