sn't considered.
Cheers,
barneyb
> -Original Message-
> From: Matt Robertson [mailto:[EMAIL PROTECTED]
> Sent: Friday, June 25, 2004 10:37 AM
> To: CF-Talk
> Subject: Re: cftransaction inside or outside cfloops?
>
> Wouldn't the answer to this be akin
Wouldn't the answer to this be akin to the standard advice of putting
cfoutputs *outside* of a cfloop? In the given example, there is
nothing meaningful going on in the loop other than stuff that needs a
cftransaction applied to it. Wouldn't applying and reapplying such a
block repeatedly be unne
Also, it may help in these situations to think of as a
kind of DB-based
Transactions, depending on the isolation level, may need to lock the db
(either on a row or table basis) to stop any other process making a
change while the transaction completes. It's worth bearing this in mind
if the loop
Steve,
Depends on what effect you want. For example, if you want ALL the
cfqueries to be processed for your entire loop or NONE of them processed
(for example if one fails), then you would want to put the
outside the loop. However, if you want each record of
'whatever' that is processed by th
Steve,
It depends more on what youre doing, than on a "Best Practice" concept.
If you're inserting into 3 tables, in a Loop, of X times, where if the
loop fails on any iteration, you'd want to roll back the entire
transaction, you'd surround the loop with the cftransaction,
But if you can
Depend on what the transaction is for. If each iteration is a atomic action
(adding multiple users), then inside would work. If each iteration is one
part of a process (recording line items on an order), then outside is a
must.
I'd say probably put it outside, that way if any of the inserts fail
6 matches
Mail list logo