Ok, I have been doing CF now for over 5 years and I have never seen this 
happen before and would like a fresh pair of eyes. 

Form submits Category and Placement.  Action page run the queries and 
then stops.  The debug information shows the queries and the information 
inserted only 1 time.  But the database, received 2 rows of the exact 
same data.  A SQL Trace shows the queries running 2 times as if they 
were in a loop, approx 20 ms apart. 

The code reads: 
<cfquery name="Renumber" datasource="#DSN#"> 
   update ArticleCategory 
   set Placement = Placement+1 
   where Placement >= '#Placement#' 
</cfquery> 

<cfquery name="InsertArticleCategory" datasource="#DSN#"> 
   insert into ArticleCategory(ArticleCategory, Placement) 
   values('#form.ArticleCategory#', '#form.Placement#') 
</cfquery> 

The debug shows: 
Renumber (Records=0, Time=0ms) 
SQL = 
update ArticleCategory 
set Placement = Placement+1 
where Placement >= '1' 

InsertArticleCategory (Records=0, Time=10ms) 
SQL = 
insert into ArticleCategory(ArticleCategory, Placement) 
values('test3', '1') 

But the Database shows: 
ID      Category    Placement 
18 test3     2 
19 test3     1 

It even renumber the first entry correctly by setting the 
placement=placement+1 

The code is only running once.  Why is the CF engine processing it 
twice.  In addition, this does not happen 100% of the time.  Rather, it 
is about 50-60% of the time. 

If I run the debug queries in Query Analyzer, it only does the operation 
1 time.  Therefore I am pointing at the CF engine. 

We are running CF 5 on Win2k SP 2, IIS. 

Any help would be appreciated. 


______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to