Mark Lundquist wrote:

I have some processing invoked from flow that's not OK to just abandon if the user abandons their session. In particular, this processing logic "reserves" some resources in the database. In the case of "success", the resources will remain permanently associated with a persistent object, but in the case of "failure" or "abandoned interaction", the resources must be released.

I model I've seen used in other ticketing sites is that you reserve the tickets for that user session for a given period of time, e.g. 10 minutes, and they become available to re-allocation after that period.

i.e.

1. [DB Trans] your application will run a transaction which finds the tickets, and then marks them as reserved for a particular session id, with an expiration time. Any tickets which have been reserved by another session, but the reservation time has expired are available for reservation.
2. you send the form requesting the credit card details from the user.
3. [DB Trans] If the details are sent by the user to your app whilst you are still in the timeout period, extend the reservation period on the reserved tickets.
4. Attempt to authorize the CC.
5. [DB Trans] Given that 4. succeeds and takes a reasonable amount of time, you can now mark the tickets as permanently allocated. This transaction should fail if the tickets have been reallocated to another session or the ticket reservation has timed out. 6. You can now complete the CC transaction, if this fails for some reason, deallocate all the allocated tickets.

If a client fails to complete any stage, or takes too long to send in their details, the tickets will be reallocatable to another client; if CC authorization fails, you can either remove the reservation, or let the time-out do its work. If final CC transaction fails for some reason, you can deallocate the tickets.

Ellis.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]