ASP page and 302 HTTP Status Code in IIS Log

Discussion in 'ASP General' started by probashi, Jun 2, 2005.

  1. probashi

    probashi Guest

    Hi,

    I have an ASP page that inserts a record into database. Some times I
    find that multiple records are being inserted (with same data) in to
    database. I checked IIS log and found the following:

    Test.asp 302 0 0 917 7266 HTTP/1.1
    ...
    Test.asp 401 5 4692 1834 0 HTTP/1.1
    ...
    Test.asp 302 0 0 1179 11171 HTTP/1.1

    For this case I got 3 records inserted into database.

    Note: Just after the database insert I am issuing an
    response.redirect().

    Thanks
     
    probashi, Jun 2, 2005
    #1
    1. Advertising

  2. probashi

    Steven Burn Guest

    Little difficult to say without seeing the code your using ..... (my mind reader isn't working today <g>)

    --
    Regards

    Steven Burn
    Ur I.T. Mate Group
    www.it-mate.co.uk

    Keeping it FREE!

    "probashi" <> wrote in message news:...
    > Hi,
    >
    > I have an ASP page that inserts a record into database. Some times I
    > find that multiple records are being inserted (with same data) in to
    > database. I checked IIS log and found the following:
    >
    > Test.asp 302 0 0 917 7266 HTTP/1.1
    > ..
    > Test.asp 401 5 4692 1834 0 HTTP/1.1
    > ..
    > Test.asp 302 0 0 1179 11171 HTTP/1.1
    >
    > For this case I got 3 records inserted into database.
    >
    > Note: Just after the database insert I am issuing an
    > response.redirect().
    >
    > Thanks
    >
    >
     
    Steven Burn, Jun 2, 2005
    #2
    1. Advertising

  3. probashi

    Adrienne Guest

    Gazing into my crystal ball I observed "probashi" <>
    writing in news::

    > Hi,
    >
    > I have an ASP page that inserts a record into database. Some times I
    > find that multiple records are being inserted (with same data) in to
    > database. I checked IIS log and found the following:
    >
    > Test.asp 302 0 0 917 7266 HTTP/1.1
    > ..
    > Test.asp 401 5 4692 1834 0 HTTP/1.1
    > ..
    > Test.asp 302 0 0 1179 11171 HTTP/1.1
    >
    > For this case I got 3 records inserted into database.
    >
    > Note: Just after the database insert I am issuing an
    > response.redirect().
    >



    Is your script checking for dupes? Is your table set up with unique
    fields? If your table is set up for unique fields, it should throw an
    error that you can catch, and act accordingly.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jun 2, 2005
    #3
  4. Hello,

    I think you are listing the requests in wrong order.

    A web browser first try to request content anonymously. If the content
    cannot be accessed anonymously, IIS responds with a 401 status code. Now
    the client sends a new request (this can happen automatically, depending
    on the settings in Internet Explorer) with logon credentials. If this
    succeeds, the webserver may reply with a 302 status code (no changes).

    The ASP file should have only been executed once however, since in the
    first try, the browser was denied access to the file.

    If the same content is posted twice to the database, i think that you
    should have a look in your code. I do not think it is a problem with IIS,
    and i do not think that these log entries is related to your problem.


    --
    Regards,
    Kristofer Gafvert (IIS MVP)
    www.gafvert.info - My Articles and help
    www.ilopia.com


    probashi wrote:

    > Hi,
    >
    > I have an ASP page that inserts a record into database. Some times I
    > find that multiple records are being inserted (with same data) in to
    > database. I checked IIS log and found the following:
    >
    > Test.asp 302 0 0 917 7266 HTTP/1.1
    > ..
    > Test.asp 401 5 4692 1834 0 HTTP/1.1
    > ..
    > Test.asp 302 0 0 1179 11171 HTTP/1.1
    >
    > For this case I got 3 records inserted into database.
    >
    > Note: Just after the database insert I am issuing an
    > response.redirect().
    >
    > Thanks
    >
     
    Kristofer Gafvert [MVP], Jun 3, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. hendy
    Replies:
    0
    Views:
    789
    hendy
    Dec 20, 2005
  2. ThunderMusic
    Replies:
    1
    Views:
    425
    bruce barker
    Jan 26, 2007
  3. hendy
    Replies:
    0
    Views:
    254
    hendy
    Dec 20, 2005
  4. hendy
    Replies:
    1
    Views:
    284
    Bob Barrows [MVP]
    Dec 20, 2005
  5. David Morgan
    Replies:
    1
    Views:
    354
    raj chahal
    Feb 24, 2006
Loading...

Share This Page