Database state maintenance and incomplete sessions

Ask a Question related to ASP Database, Design and Development.

  1. #1

    Default Database state maintenance and incomplete sessions

    This is a question with regards to using a database for maintaining
    state on a site. I'll use the Shopping Cart application from the
    ASPFAQ.com site as an example.

    The question concerns users who start shopping but do not complete
    their session and do not proceed to the 'checkout counter'.

    The Shopping Cart application uses a table called Cart to track the
    products that I have added to my shopping cart while shopping. If I
    add a number of items to the cart and then shut down the browser with
    these items still in my shopping cart these items remain in the Cart
    table on the database and are not removed. On a busy production system
    this could result in a very large Cart table that is full of
    incomplete orders.

    My question is, how is this handled in a real life production
    environment? How would this Shopping Cart application be written if it
    was intended for real life use so that the Cart table does not
    accumulate all these incomplete orders that users have abandoned. Is
    there a way to 'rollback' an order if it is detected as incomplete?

    Eg. Could I use a 'temporary' table on the database to store the items
    that the user has added to his basket and only commit the data to the
    Cart table after he reaches a certain point in the transaction, eg.
    when his credit card information has been verified and the order
    submitted?
    Luis Guest

  2. Similar Questions and Discussions

    1. Sessions State Lost in CFMX and WebLogic - HELP
      We are currently using ColdFusion 6.1 with WebLogic 8.1 and are having problems with the session replication and/or server failover. I decided to...
    2. database sessions persists after and </cfquery>
      Quick question for all CF gurus. I 'm trying to alter user passwords in my db. To do this I call a stored proc that issues "Alter user" SQL. I...
    3. Database sessions and file sessions
      Can database sessions and file system sessions co-exist on the same server. I have 2 applications that use sessions. One uses the standard php...
    4. run metadb against previously configured state database slices
      If run metadb against the solices which metadb was configured previously, will it overwrite the previous configuration? Thanks!
    5. best practice question regarding AspState database for sessions
      Quick question regarding best practices for using the AspState database for storing session variables in .NET web applications. I know I need to...
  3. #2

    Default Re: Database state maintenance and incomplete sessions

    > these items still in my shopping cart these items remain in the Cart
    > table on the database and are not removed. On a busy production system
    > this could result in a very large Cart table that is full of
    > incomplete orders.
    >
    > My question is, how is this handled in a real life production
    > environment?
    You have a job that cleans up sessions where page activity is older than the
    session timeout. See the following article for some ideas:

    [url]http://www.aspfaq.com/2491[/url]

    Note that it uses an img src but it could also use an #include file or
    something else to track the user's activity by session.
    > Eg. Could I use a 'temporary' table on the database to store the items
    > that the user has added to his basket and only commit the data to the
    > Cart table after he reaches a certain point in the transaction, eg.
    > when his credit card information has been verified and the order
    > submitted?
    Well, that doesn't solve the issue at all. It just places the burden of
    "cleaning up" on a table with a different name - because now you have to
    worry about the temporary table filling up with incomplete orders and
    abandoned sessions. Right?

    --
    Aaron Bertrand
    SQL Server MVP
    [url]http://www.aspfaq.com/[/url]


    Aaron Bertrand - MVP Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139