Double-execution of CFML code can happen when people close their
custom tags with a trailing slash, not realizing that the closing
slash causes a second-run of the custom tag. Most commonly
double-execution happens when users double-click submit buttons or
when a user gets frustrated at a slow page and refreshes it a few
times, although I doubt this is happening in your case since you are
able to reproduce the error in a controlled environment.

-Mike Chabot

On Wed, Jan 13, 2010 at 7:58 PM, Ali Awan <[email protected]> wrote:
>
> Brad,
>
> Thanks for the helpful suggestions.
>
> In terms of numbers of inserts, well it's an insert statement within a cursor 
> loop.
> There's 305 records being added so it loops 305 times and does an insert.
>
> As I mentioned in my last post.
>
> When I take my execution page out of the pseudo-fusebox app and run it 
> separately, it works perfectly each time.
>
> So what I did was add an application counter in the original app on the query 
> page, and yes it was calling it multiple times for no reason.
>
> So fine, I figured, I'd just put an IF statement around the stored proc.
>
> However, what I found was that the error was happening even if my counter was 
> 1 or 0, meaning that the first time through, it was still getting a primary 
> key constraint error.
>
> So, I have determined that internally, either the CF server or the JDBC 
> driver or some way in which the cfstoredproc is being handled, is executing 
> the stored procedure in SQL multiple times.
>
> Even if I have a SQL Profiler, it's not going to help in telling me how to 
> stop that.
>
> And if that is true, then how come ColdFusion handles it differently when I 
> pull that CF page out of that app, and run it by itself?
>
> Ali
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329669
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to