On May 28, 2009, at 7:41 AM, Johan Henselmans wrote:

Second approach would be to store all the session information (the products, user info etc) in a database table, and, once the user gets back from the payment, pickup from there, and restore it's previous information. But that might mean that the reservation on products that have taken place (and are deducted from the available products) will wait forever because the user is not returning.

So a thread would have to run all the time and remove all the reservations that have not paid in let's say ten minutes.

If you want to run a separate thread to do this type of clean up, I suggest using Quartz (http://www.opensymphony.com/quartz/) for doing this. I use it to automate Order Importing and other reoccurring data integration functions between my WO app and other systems. Quartz has all the logic in it already for how to schedule, what to do if a job is interrupted or fails, etc. All you really have to do is write the business logic for what to do when the scheduler triggers a given job.

I have created a separate WO Application that does this function. It uses my foundation framework and the Quartz library and has all the schedule definitions. The actual business logic for the integration is in the foundation framework so it is easy to manually call the functions from within my main app if needed, but the automated scheduling and calling is handled by this Scheduled Tasks application.

Since I'm running it as a separate app, I have to be more careful about the app and database getting out of sync, but those are pretty straight-forward issues, common to most any app.

This solution works extremely well for me.

Dave
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to