Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

WebClass/Javascript record locking issues

Posted on 2002-06-13
5
Medium Priority
?
181 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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

730 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