[CDBI] Deep recursion from before_create trigger

Phil Mitchell seasprocket at gmail.com
Sat Sep 10 00:26:24 BST 2005

I want to do data normalization in before_create trigger. So I access
columns such as $self->title() and normalize the value (if it exists).
The infinite loop arises when that column has not in fact been set --
I'm guessing bc CDBI then wants to fetch it from the DB, but it
doesn't exist yet ... although I don't really understand that.

Anyhow, it is fixed by using $self->{title} instead, but this seems
ugly and leaves me nervous. I'd like to understand what's going on and
whether it's a bad idea to do this kind of work in the trigger...
2People Blog: http://2-people.blogspot.com/
2People site: http://www.2people.org

More information about the ClassDBI mailing list