I have come closer to figuring out how there are two updates running.
On a SGI Irix box running Netscape the user can double click the submit
button on the form. I looked in the web log files and saw this:
127.0.0.1, -, 1/16/02, 20:14:03, W3SVC, SERVER, 127.0.0.1, 172, 513, 504,
200, 0, POST, /employee/JOBLOGIN.CFM, -,
127.0.0.1, -, 1/16/02, 20:14:03, W3SVC, SERVER, 127.0.0.1, 203, 513, 504,
200, 0, POST, /employee/JOBLOGIN.CFM, -,
Is there any way to keep people from double clicking on the submit button
and getting two POSTs?
At 07:39 PM 1/16/2002 -0500, you wrote:
>I am getting strange inserts every once and while. Not all the time, it
>has only happened 3 times in the last 4 months. What is happening is
>somehow people are getting two (one time a person got 40+) inserts into the
>table when they should only get one insert. Tonight i added a <CFLOCK>
>around the entire process, but im not sure if that will help.
>
>Why, or how could the insert run more then once?
>Is there a better way to write the following code?
>
>
><!--- check to see if the user is in the table --->
><cfquery name="employeejobcheck" DATASOURCE="#dsn#" dbtype="ODBC">
>SELECT JOBNUM, EMPLOYEENUM, LOGOUT, LOGIN
>FROM ACTIVITYLOG
>WHERE (JOBNUM = #FORM.JOBNUM#) AND (EMPLOYEENUM = #FORM.EMPLOYEENUM#)
AND
>(LOGOUT is null) AND (LOGIN is not null)
></cfquery>
>
><!--- if the user is not in the table insert them --->
><cfif employeejobcheck.recordcount eq 0>
>
><cfquery DATASOURCE="#dsn#">
>INSERT INTO ACTIVITYLOG(
>ACTIVITYDESCRIPTION,ACTIVITYID,COSTPERHOUR,JOBNUM,EMPLOYEENUM,EMPLOYEENAME,
LOGIN)
>VALUES
>('#ACTIVITYLOOKUP.ACTIVITYDESCRIPTION#','#ACTIVITYLOOKUP.ACTIVITYID#',#ACTI
VITYLOOKUP.COSTPERHOUR#,#FORM.JOBNUM#,#FORM.EMPLOYEENUM#,'#FORM.EMPLOYEENAME
#',#NOW()#)
></cfquery>
>
></cfif>
>
>
>Thanks,
>Chad
>
>
______________________________________________________________________
Why Share?
Dedicated Win 2000 Server � PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
Instant Activation � $99/Month � Free Setup
http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists