Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

WebClass/Javascript record locking issues

Posted on 2002-06-13
5
Medium Priority
?
184 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 800 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

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

877 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