Re: [CDBI] Class::DBI and DESTROY

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

From: Perrin Harkins
Subject: Re: [CDBI] Class::DBI and DESTROY
Date: 14:16 on 10 Nov 2005
On Thu, 2005-11-10 at 13:15 +0000, Steven Mackenzie wrote:
> I have tried to add some new methods to one of my Class::DBI classes,
> but they require state to be preserved for each instance. I didn't want
> to just stash my state in the cdbi object hash (it didn't work anyway),
> so I'm using a variation of "Perl Best Practices" inside out classes.

I recommend you go back to shoving thing in the Class::DBI hash.  It's a
lot easier and you are writing something for a specific version of
Class::DBI on your own system.  Of course if you were planning to make
this into a CPAN module, you should think twice about doing it this way,
since other people will have different versions.

> But DESTROY is being
> called far more often than I expected.

This is the opposite of the complaint that most people have with Perl --
that DESTROY is never called.

> Can anyone share some insight in to my problem (why is DESTROY being
> called so often?), or offer a better approach for me?

Maybe cdid is not really a unique key of your class, so one CD's DESTROY
cleans up another one?  Maybe you have a scoping problem with %
card_writer_of.  I'm pretty confident that DESTROY is not being called
on objects that are still in scope.

- Perrin


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

(message missing)

[CDBI] Class::DBI and DESTROY
Steven Mackenzie 13:15 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Perrin Harkins 14:16 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Perrin Harkins 15:57 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Steven Mackenzie 16:12 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Perrin Harkins 16:17 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Steven Mackenzie 16:48 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Steven Mackenzie 15:57 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
William Ross 16:42 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Steven Mackenzie 17:10 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
William Ross 18:17 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Matt S Trout 18:36 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Steven Mackenzie 19:20 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Perrin Harkins 16:51 on 10 Nov 2005

Re: [CDBI] Class::DBI and DESTROY
Matt S Trout 19:43 on 10 Nov 2005

Generated at 23:12 on 13 Nov 2005 by mariachi v0.52