0

I'm working on a project for my school assignment, and I may have a problem.

I'm creating web portal which is all about reservations and ads. Reservations for a single ad are stored in a row and whenever one of them expires (duration: 5 days), it is supposed to be marked as expired, and the next one from the row is supposed to get sequence number 1, and be marked as active (was pending). I need a solution to get this done :(

Is there a way to make a project besides my .NET project to run in the background and check these things all the time?

Thank you all so much!

If there is any thing I can explain better please do ask.

Language : C# .Net

Database : mySql

Tools : Visual Studio 2012, Workbench, ...

2
  • It's customary to show what you have tried. Commented Jun 7, 2013 at 9:46
  • First thank you for formatting :) And I didn't try any thing because I really do not know how... That is why I was asking in the first place... Commented Jun 7, 2013 at 10:21

2 Answers 2

1

Essentially you have at least two options, look at using SQLDependency so that when 'it' is marked as expired sqlserver will inform your application and you can do what you like.

Or use a polling system, from within your existing project simply poll the database say every 60 mins to see if 'it' is marked as expired, and then, do what you like.

There's no need for a seperate project.

EDIT: Not sure if sqldependency will work with mySql, maybe something like SqlCacheDependency could be used instead, although to be honest unless you must absolutely have 'live' data a polling solution is nice and easy and more maintainable, something like sqldependency is bug ridden and can be a pain to implement.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you a lot... I'm going to try to implement pooling system, and will be back with some results hopefully :) Do you have some links where I can read about pool system implementation? Thanks again...
0

You could write programatically your changes in a helper class that checks if the time that has passed is >=5 days and then do whatever you need. Have a look at

http://hangfire.io/

I have found this very useful in creating reccuring background jobs.

note: Of course this will all work if you are using EF6

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.