Re: [Fwd: Re: [CDBI] 2 Questions?]

[prev] [thread] [next] [Date index for 2005/09/15]

From: melo_am0
Subject: Re: [Fwd: Re: [CDBI] 2 Questions?]
Date: 19:34 on 15 Sep 2005
> If your DBD's thread safe, CDBI should be thread safe. The DBD probably
> isn't though ...
>

>> Secondly, is there a safe way to have a constructor that's called each
>> time CDBI instantiates an object? I have a trigger set on before_create
>> and select, but sometimes a class's constructor is never called, and
>> other times the constructor is called twice.
>
> Overriding 'construct' may do the trick for you.

No dice, the construct isn't called during my::class->create calls. Same
with new...perhaps there's something blindingly obvious I'm missing, but
it seems like providing user-supplied constructors would be a fairly
simple proposition.


> DBIx::Class gets round this by having a real 'new' method, which makes
> life rather simpler (and also allows objects not in the db - create is
> just a shortcut for ->new(...)->insert)

Sounds interesting. Would a transition to DBIx::Class be particuarly
difficult?

Thanks for your help-

Andrew


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

Re: [Fwd: Re: [CDBI] 2 Questions?]
melo_am0 19:34 on 15 Sep 2005

Re: [Fwd: Re: [CDBI] 2 Questions?]
Matt S Trout 20:21 on 15 Sep 2005

Generated at 21:47 on 18 Sep 2005 by mariachi v0.52