update the record but only one user ... the time space for other user is for wating...

Last post 08-28-2008 2:58 PM by atanu.podder. 2 replies.

Sort Posts:

  • Smile [:)] update the record but only one user ... the time space for other user is for wating...

    08-28-2008, 8:32 AM
    • Member
      point Member
    • prashantsvl
    • Member since 08-27-2008, 5:50 AM
    • Posts 1

     

    hello experts..

    I am trying to  update the record ... the record update sucessfully . but if there are nos users and if user "A"

    trying to update the record &  simultaniosly update the user "B" trying to  update the record  then there should be the message to user 'B'    " currently

    updating the record... u dont have the chance.. "

     so how this situation can handle????????

    reply as early as possible...

    prashantsvl 

     

     

     

     

  • Re: update the record but only one user ... the time space for other user is for wating...

    08-28-2008, 8:55 AM
    Answer
    • Contributor
      5,082 point Contributor
    • mrmercury
    • Member since 04-04-2006, 6:26 PM
    • Mexico City, Mexico
    • Posts 739
    You could use optimistic locking, one way of doing it is using a timestamp in your record, on submit compared against the database, if it’s different then you would tell the user another user has changed the record.
    If this post helped you please remember to set it as Answer so it can help others.
  • Re: update the record but only one user ... the time space for other user is for wating...

    08-28-2008, 2:58 PM
    Answer
    • Participant
      1,274 point Participant
    • atanu.podder
    • Member since 08-20-2008, 7:40 AM
    • Bangalore
    • Posts 191

     

    You should use some column to indentify the last updated date time. Takin your case, applying my approach:

    In the database I have one row which user A and user B both are tryin to update.

    What I suggest is:

    To update a record you need to select the same, while selcting provide the last updated datetime as well, suppose that was 080820081112. So, user A and user B both have selected the same record and has same   last updated datetime value i.e. 080820081112. Now, when user A updates the records, obviously the last updated datetime value would be changed, supposse it bacame 080820081116, now when user B tries to update the same, since the value of last updated datetime does not match with the current one in the database, throw a diffferent message.

    Thats it!

    Thanks,

    Atanu 

    Thanks,
    Atanu, Symphony Services

    P.S. Dont forget to mark this as answer, if you have got resolution to your problem from this post.
Page 1 of 1 (3 items)