Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 Development Tools
 ASP.NET
 Double entry

Author  Topic 

bazz
Starting Member

26 Posts

Posted - 2003-06-03 : 10:41:28
Hi i am having stressful day

I have just implemented this browser based HTML editor.
It work great on my development server but when i run it on my test server it adds the record twice.

I know it isn't my asp script that adds the record twice as i have been up and down it.

I ran a trace on the database and it adds the second record less than a second after the first one.

Could it be my database? I haven't done any thing special to the setting and there are no triggers.

Or is something to do with cache?



Edited by - bazz on 06/03/2003 10:42:13

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-06-03 : 11:06:13
Hate to say it, but most often these things are asp related

Or do you have any weird javascript validation code resubmitting the form ?

Damian
Go to Top of Page

bazz
Starting Member

26 Posts

Posted - 2003-06-03 : 12:07:41
I'm pretty sure it's only running the script once as i have put in a javascript alert message where the code adds the record to the database.

All the error checking is done via asp.

I'm goning to implement a stored procedure to add the record and if that doesn't work i'm taking a bat to the test server. (may get fired, but i'm prepared to take that risk)

Cheers

Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-06-03 : 12:16:59
Now I am SURE your client side code is doing something funky.

You can NOT have a JS alert when the proc is called. Because your proc is called at the server side and your dialog is called on the client side. A multitude of things go on in between those two events.

I am guessing, you have some JS interrupting your form after the submit button is hit. Or you are using JS to submit. What is possibly happening is that one of your servers works faster than the other one so the submit is handled before the second http request is fired.

Damian


Edited by - merkin on 06/03/2003 12:17:48
Go to Top of Page

bazz
Starting Member

26 Posts

Posted - 2003-06-04 : 05:42:11
No i only had the javascript in there to see if my site was running the add sub routine twice (not a good way to check this). It wasn't. It does the double entry with or without the javascript.

I implemented a stored procedure and it still does a double entry.

I am absolutely lost.

It must have something to do with the actual DHTML.

And my development computer is atually faster than my test server.

Groan!





Edited by - bazz on 06/04/2003 05:45:38
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-06-04 : 06:21:25
quote:

i only had the javascript in there to see if my site was running the add sub routine twice



Do you understand why that is no good ?

Have you tried running profiler while this is running ?

This isn't your database, it has to be in your asp code somewhere.

Damian
Go to Top of Page
   

- Advertisement -