Solved

WebClass/Javascript record locking issues

Posted on 2002-06-13
5
173 Views
Last Modified: 2010-05-02
The Scenario,

I have an Intranet application and a web page which populates a form with a db record's data, and sets the db record to locked. On submit, or cancel, this lock is freed.

However, if the user, closes the web page, or the web page loses visibility (Back/Front) then the lock should be freed. This event can be caught in the OnUnload event, but how can I create a dummy webitem to free the record and continue with the users original event??

Any advice could be a possible life saver!
0
Comment
Question by:mm_glebe
5 Comments
 
LVL 23

Accepted Solution

by:
b1xml2 earned 200 total points
ID: 7075783
do not use the OnUnload event. You will have to use the onBeforeUnload event! It is safer. You can also use the Window_OnBlur() event which fires when the window loses focus/visibility as you put it.

Frankly, you should not be locking the record. You should put a timestamp for the client to receive in the record. So when the client tried to upload , if the timestamp does not match, he will be shown the newer record and ask if he still wants to push thru his changes.

The web(Intranet or otherwise) should have a disconnected approach lest your web application suffers and you have to waste precious time and money trying to fix a problem which should never have arisen in the very first place. =)
0
 

Author Comment

by:mm_glebe
ID: 7075843
Thanks b1xml2.

Generally I would agree with the optimistic locking response, but the project is nearer conclusion and it's too late in the day for any real changes.

Using the locking method, do you know of anyway of freeing the lock by firing a WebClass webitem on the OnBeforeUnload event?
0
 
LVL 23

Expert Comment

by:b1xml2
ID: 7075875
you could fire a webclass webitem by opening another window and performing your server-side scripts there to free the lock.
0
 
LVL 49

Expert Comment

by:DanRollins
ID: 7900213
Hi mm_glebe,
It appears that you have forgotten this question. I will ask Community Support to close it unless you finalize it within 7 days. I will ask a Community Support Moderator to:

    Accept b1xml2's comment(s) as an answer.

mm_glebe, if you think your question was not answered at all or if you need help, just post a new comment here; Community Support will help you.  DO NOT accept this comment as an answer.
==========
DanRollins -- EE database cleanup volunteer
0
 

Expert Comment

by:SpideyMod
ID: 7978199
per recommendation

SpideyMod
Community Support Moderator @Experts Exchange
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now