Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_databases thread: Deleting a record on exit.


Message #1 by "Dieter Lubbe" <dieterl@z...> on Thu, 8 Jun 2000 15:50:46 +0200
Is there a way to delete a row in the database when someone close their

browser?



I need to delete a record as soon as they leave.



Cheers

Dieter



Message #2 by "Jessica Chen" <jchen@g...> on Thu, 8 Jun 2000 10:31:08 -0400
I assume that you can put the delete code in the sub session_onend and put

in the global.asa.



Jessica



-----Original Message-----

From: Dieter Lubbe 

Sent: Thursday, June 08, 2000 9:51 AM

To: ASP Databases

Subject: [asp_databases] Deleting a record on exit.





Is there a way to delete a row in the database when someone close their

browser?



I need to delete a record as soon as they leave.



Cheers

Dieter



Message #3 by John Doolan <Johnd@m...> on Thu, 8 Jun 2000 15:47:54 +0100
Dieter,

	What's the scenario? It sounds to me as if you may be better off

using Session variables or cookies to store data as temporary as this.

- John Doolan



-----Original Message-----

From: Dieter Lubbe 

Sent: 08 June 2000 14:51

To: ASP Databases

Subject: [asp_databases] Deleting a record on exit.





Is there a way to delete a row in the database when someone close their

browser?



I need to delete a record as soon as they leave.



Cheers

Dieter



Message #4 by "Dieter Lubbe" <dieterl@z...> on Mon, 12 Jun 2000 01:44:40 +0200
What I'm trying to do is to create a booking system for our golf course.



What I'm doing is writing all the booked tee-off slots to a database.

That's all fine and dandy ,but what do I do if two people wants to book the

same slot simultaneously?



Say I'm busy booking a slot, That slot gets written to the database and

flagged as reserved so that other people on the site, looking for the same

slot, can see that it's been reserved.

Now if I close my browser, without finalizing the booking, that slot still

stays reserved.



I need to find a way to delete this "reserved slot" if I close my browser.



Any idea on how to accomplish this?



Thanx,

Dieter



----- Original Message -----

From: John Doolan 

To: ASP Databases <asp_databases@p...>

Sent: Thursday, June 08, 2000 4:47 PM

Subject: [asp_databases] RE: Deleting a record on exit.



> Dieter,

> What's the scenario? It sounds to me as if you may be better off

> using Session variables or cookies to store data as temporary as this.

> - John Doolan

>

> -----Original Message-----

> From: Dieter Lubbe

> Sent: 08 June 2000 14:51

> To: ASP Databases

> Subject: [asp_databases] Deleting a record on exit.

>

> Is there a way to delete a row in the database when someone close their

> browser?

>

> I need to delete a record as soon as they leave.

>

> Cheers

> Dieter

>
Message #5 by "Piotrowski, Sebastian" <Sebastian.Piotrowski@a...> on Mon, 12 Jun 2000 19:01:07 +1000
I know that ie has an onUnLoad event, not sure if this also applies to

netscape

This msdn article may help 

(note: the following URL may wrap)

http://msdn.microsoft.com/library/partbook/asp/theonloadonunloadevents.htm





But it may be a better idea to have a look at the logic/transactions in your

web application

ie. the time slot should not be flagged as booked unless the transaction is

complete



Sebastian



-----Original Message-----

From: Dieter Lubbe 

Sent: Monday, 12 June 2000 9:45

To: ASP Databases

Subject: [asp_databases] RE: Deleting a record on exit.





What I'm trying to do is to create a booking system for our golf course.



What I'm doing is writing all the booked tee-off slots to a database.

That's all fine and dandy ,but what do I do if two people wants to book the

same slot simultaneously?



Say I'm busy booking a slot, That slot gets written to the database and

flagged as reserved so that other people on the site, looking for the same

slot, can see that it's been reserved.

Now if I close my browser, without finalizing the booking, that slot still

stays reserved.



I need to find a way to delete this "reserved slot" if I close my browser.



Any idea on how to accomplish this?



Thanx,

Dieter



----- Original Message -----

From: John Doolan 

To: ASP Databases <asp_databases@p...>

Sent: Thursday, June 08, 2000 4:47 PM

Subject: [asp_databases] RE: Deleting a record on exit.



> Dieter,

> What's the scenario? It sounds to me as if you may be better off

> using Session variables or cookies to store data as temporary as this.

> - John Doolan

>

> -----Original Message-----

> From: Dieter Lubbe

> Sent: 08 June 2000 14:51

> To: ASP Databases

> Subject: [asp_databases] Deleting a record on exit.

>

> Is there a way to delete a row in the database when someone close their

> browser?

>

> I need to delete a record as soon as they leave.

>

> Cheers

> Dieter

>
Message #6 by John Doolan <Johnd@m...> on Mon, 12 Jun 2000 10:38:57 +0100
Hmm, I think you may be better off looking at some other way of doing this.

After all, what happens if the user's PC crashes or for some other reason

the OnUnload event does not trigger?  With your current logic the

transaction will remain in 'limbo' for ever.  It may be better to have some

form of 'provisional booking' flag with a timestamp that maybe gives the

user 30 minutes to complete the transaction.  For the next 30 minutes this

time slot would be filtered out of any list of available time slots and if

it is still unconfirmed after 30 minutes it is released.  There may be a

better way of doing it than this, but this is just a first thought on my

part.

- John Doolan



-----Original Message-----

From: Dieter Lubbe 

Sent: 12 June 2000 00:45

To: ASP Databases

Subject: [asp_databases] RE: Deleting a record on exit.





What I'm trying to do is to create a booking system for our golf course.



What I'm doing is writing all the booked tee-off slots to a database.

That's all fine and dandy ,but what do I do if two people wants to book the

same slot simultaneously?



Say I'm busy booking a slot, That slot gets written to the database and

flagged as reserved so that other people on the site, looking for the same

slot, can see that it's been reserved.

Now if I close my browser, without finalizing the booking, that slot still

stays reserved.



I need to find a way to delete this "reserved slot" if I close my browser.



Any idea on how to accomplish this?



Thanx,

Dieter



----- Original Message -----

From: John Doolan 

To: ASP Databases <asp_databases@p...>

Sent: Thursday, June 08, 2000 4:47 PM

Subject: [asp_databases] RE: Deleting a record on exit.



> Dieter,

> What's the scenario? It sounds to me as if you may be better off

> using Session variables or cookies to store data as temporary as this.

> - John Doolan

>

> -----Original Message-----

> From: Dieter Lubbe

> Sent: 08 June 2000 14:51

> To: ASP Databases

> Subject: [asp_databases] Deleting a record on exit.

>

> Is there a way to delete a row in the database when someone close their

> browser?

>

> I need to delete a record as soon as they leave.

>

> Cheers

> Dieter

>

  Return to Index