views:

30

answers:

1

Hi there,

I am currently building a webshop for my own where I want to increment the product-stock when the user fails to complete payment within 10 minutes after the customer placed the order. I want to gather information from this thread to make a design decision.

I am using SQL Server 2008 and ASP.NET 3.5. Should I use a SQL Server Job who intervals check the orders which are not payed yet or are there better solutions to do this.

Thanks in advance!

Martijn

+1  A: 

Good question. I would work with a scheduled job. Run it every minute.

If the application is larger, a triggered application may also work (an exe that you start from the job scheduler in asp.net). Depends on the logic - I would not put more into the stored procedure than I have to in business logic, if you do stuff there that is more complicated - i would not put it into SQL.

TomTom
Is it possible to trigger a scheduled job and run it for the time there are active unpaid orders (order which are not payed but still in the 10 minute time window)
Martijn B
No, and it makes little sense. The trigger condition would be too complicated. What you can do is trigger a job every minute that first checks what orders are unpaid for 10 minutes and then processes those - and then falls asleep again.
TomTom