Solved

WebClass/Javascript record locking issues

Posted on 2002-06-13
5
175 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

785 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