cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ellis Pritchard <>
Subject Re: callback for continuation timeout?
Date Tue, 01 Nov 2005 16:20:18 GMT
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.


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.


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message