I'm in a position where a component can have a parent/child relationship
with other components of the same type.

When I delete a single component, no problem - the method starts a
transaction, deletes the component information from the database, cleans
up references to it in several join tables and updates a couple of
administrative tables.

When a component has Children I would like to delete them as well in the
same transaction.  The best way to do this, of course, is to loop
through the children and call their "delete()" methods.

However when I do this (as I am) from with the parents delete() method
(making the call sorta recursive-like) I get the error we all know and
love: "Cannot nest CFTRANSACTIONS"

In short I don't want to really nest a transaction (that makes no real
sense) I simply want a way to include all the work in a single
transaction.  Some way to determine if I'm in a transaction already and
not try to start a new one.

I'm trying to find some way to do this, perhaps by catching and using
the nesting error itself - but nothing remotely elegant is presenting
itself.

Any solutions, ideas or workarounds?

Jim Davis


[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to