Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Jul 2002
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Allow same login for mulitple users

    Hi guys,

    We were about to launch the website we have designed and thought to test the load time and performance just before we go for launch.

    Well, the testing left us with 2 major questions ....

    1) Users can use same login to get into the website. Well, we tried mutiple people using same login, trying to access the same records at the same time, "We got white pages quite often", even in the server log there wasn't anything recorded. Few time log says that the "record is not found". May be one of the users has deleted it.

    I was wondering how do you implement and deal this sort of situation.... How does the other user know that the record is updated/deleted by some other user ....

    I really need your suggestion on this and hope I explained it well.

    2) Load Time - We tested the load time for all the pages, internally and though modem as well. Some pages were taking so long. There was no graphics. Mainly the login page, which go and get the security info from the cookies already setup on client's computer. My guess, accessing infor from cookies shouldn't be the only cause for the slow loading. Also, in this scenario, people received the blank page.


    3) What are the best practices to test the load time and debug them or know why is that happening !!!

    Any help is appreciated.

    Thanks,
    NRastogi

  • #2
    raf
    raf is offline
    Master Coder
    Join Date
    Jul 2002
    Posts
    6,589
    Thanks
    0
    Thanked 0 Times in 0 Posts
    about 1:
    the user can only see changes when he loads a page (containing the data from the record), or when a loaded page is refreshed.
    in my experience, html-pages can best be updated on the client-side, so you probably need an autorefresh (in Javascript or something like that). be very carefull refreshing pages that insert/update records in your database !!

    permitting a user to login more then once, and letting those users modify your data, is something i would never consider. miltiple-logins for viewing data is fine, buth modifying ...

    what you could do is : check against your database when they login, whether "this user" is already loged in, and report this to the user (all of them). for this you need:
    - field in your database to register if user is logged in
    - field on html-pages (all-pages, or use a frameset end puth it in one of the frames)
    - a good (a verry good) system to monitor log-off's of the users (they won't all hit the "exit" button) look for more info about this on the asp forum

    to signal changes, you need:
    - field in your database for every record, where you store the time and user that last modifiŽd the record
    - write a cookie to the users PC when he performs a databaseopperation, that contains the time and user-id he's loged in with (time must be exactly the same as in database, so has to be pulled from a variable on the page where you write the cookie and make the databaseconnection.)
    - if another user searches for this data, the 'last modifying time and user' must be selcted + the cookie must be read. If their isn't a match between the two (or their isn't a cookie), then it was 'another user' that last modified that record, and you could signal this to this user.

    to avoid that a database-operation is (tried to be) executed on a changed/'deleted' record:
    - make a select for that record first and do the above (it's probalby whise not to delete the record, buth to use a variable that checks if the record is still active + clean them up after some time (or when all the users with that login have logged off)) If the record had been updated by another user, since the page was loaded (compairing the last modifying time, the cookie-time and the time when the page was loaded), you could reload the original page + show the changed data and signal that the changes were preformed by another user at a specified time.

    example : you search for a product (select query) on page 1 (register time when recordset was returned in a session-variable (for asp) or something like that). show some data about the product on a form (page 2) in editable fields. when the user wants to submit page 2, first make a select for the product and check when it was last updated. if this was done by another user, and between the return of the recordset and the submit of page 2, signal this + show new data
    with an autorefresh of the page 1 (and consequently refreshing page 2) you could create a more "up to date" situation, buth it would result in huge networktrafic.


    what's causing your problems depends on the action your performing on the database.


    about 2 : loading time can depend on a lot of things. the best way is control it is to avoid problems when programming an when choosing for products. avoid database-connection, reloading immages, cacch non-changing pages on your server etc etc


  •  

    Posting Permissions

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