Global.asa Session_OnEnd

S

steven scaife

I have an ASP application that is a electronic purchase orders system. My
problem is that only 3 people can authorise a purchase order. When a
purchase order is selected I update the table to show that the field is
locked. If they complete the form then the database is updated and the lock
is removed, all though at this stage the record moves into another part of
the system and the lock becomes redundant.

If however they dont complete the form the record is left in a permanent
locked state, it could be that they decided to look at the record then
navigated away or closed the browser.

So i thought maybe i could stick some code that updates the database into
the session_OnEnd in the global.asa, so after 20 minutes when the session has
ended the lock will free. I don't however have any experience with this and
don't even know if this will work. The code won't be a problem its just
whether this process will actually work.

I am thinking that I code put the order_id into a session variable then when
the session variable ends i run a sub in the .asa file that gets the session
variable and updates the table.

Am I thinking correctly here or have i misunderstood the event and its
purpose, or is there a better way of achieving the task.

TIA
 
T

Tom Kaminski [MVP]

steven scaife said:
I have an ASP application that is a electronic purchase orders system. My
problem is that only 3 people can authorise a purchase order. When a
purchase order is selected I update the table to show that the field is
locked. If they complete the form then the database is updated and the
lock
is removed, all though at this stage the record moves into another part of
the system and the lock becomes redundant.

If however they dont complete the form the record is left in a permanent
locked state, it could be that they decided to look at the record then
navigated away or closed the browser.

So i thought maybe i could stick some code that updates the database into
the session_OnEnd in the global.asa, so after 20 minutes when the session
has
ended the lock will free. I don't however have any experience with this
and
don't even know if this will work. The code won't be a problem its just
whether this process will actually work.

I am thinking that I code put the order_id into a session variable then
when
the session variable ends i run a sub in the .asa file that gets the
session
variable and updates the table.

Am I thinking correctly here or have i misunderstood the event and its
purpose, or is there a better way of achieving the task.

This should answer most of your questions:
http://www.aspfaq.com/show.asp?id=2078
 
S

Sylvain Lafontaine

A possible solution would be to add a DateTime field to your table and
associate it with the lock. After that, you can take the lock as invalid if
the time value is older than 20 minutes.

(BTW, I don't really understand why you need a lock to do that.)
 
E

Evertjan.

Sylvain Lafontaine wrote on 02 sep 2005 in
microsoft.public.inetserver.asp.general:
A possible solution would be to add a DateTime field to your table and
associate it with the lock. After that, you can take the lock as
invalid if the time value is older than 20 minutes.

much better than locking out the new session of a user,
lock out the old session.

Put the most recent session-id in the database,
and have all sessions check for the right sessionID.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top