Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

c# - The best way to let asp.net fire events and methods automatically -according to a schedule- -


well, i'm sure not first time see question. , tbh can find question answered on many other websites , blogs -not here-

but never saw complete answer question, mean no 1 talked advantages , disadvantages. no 1 shared real experience.

although quartz.net seems solution yet, there's no enough reviews or comparison between different ways achieve such thing.

as far read found possible ways of doing :

using a: web service, windows appliction, console application, quartz.net.

examples of stuff want achieve scheduled or automatic methods/events archiving after period, auto deleting/moving records in database, setting property of object after time, automatically run methods according holiday schedule.

i hope you'd share experience either 1 of approaches or share new way of doing this.

at e-commerce web site work for, use quartz.net in windows service called "worker". executes quartz.net ijob implementations via programmatically-defined schedule , runs independently of web site processes. things dispatch e-mails in batches, update statistics, refresh solr indexes, , on.

this way, don't have worry our schedules getting reset or missed result of worker processes recycling, or dealing madness of having multiple instances running simultaneously on same machine result of web garden. worker installed, started, , stopped independently of web site, , exist on separate machine, giving flexibility in maintenance , deployment.

the web site , worker both share common model dll contains object model , nhibernate configuration, there not logical duplication of business logic.

before created worker/windows service, relied on simple console applications executed via scheduled tasks. worked point, site became more complex , required more , more batch jobs run periodically, found myself maintaining lot of independent console programs , lot of independent scheduled tasks, became more difficult number of jobs required increased. consolidating scheduling quartz.net single windows service, have 1 process keep eye on , can assured business logic changes "in sync" since model has updated in 2 places--the worker , web site--instead of many--the web site , lots of little console applications.

i explored options storing runtimes in asp.net cache or keeping references around in worker process's memory, found (1) made exact execution time of task dependent on incoming requests web site , (2) use of web garden caused unnecessary duplication of effort (since task "scheduled" in multiple worker processes on same machine).

creating windows service can started , stopped via usual windows mechanisms has proved be, in humble opinion, logical, intuitive, , maintainable result in long run.

both web site , worker use wix compile down 2 windows installer msi files, updating them snap--just double-click msi on server, , our update go.

hope helps!


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -