Solved

WebClass/Javascript record locking issues

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

920 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

15 Experts available now in Live!

Get 1:1 Help Now