SharePoint 2010 Timer Job: Development and its Pitfalls
A lot has been already written on timer jobs in Sharepoint 2010 and it does not make sense to write all that all over again rather it would be worth mentioning all the phases of this TImerJob development and cautions that one should exercise. Because devlopment of a timer job is nasty business and can turn quite tricky sometimes. For example
There are two crutual parts of a timer job.
1. Feature recieve and feature activation method
2. Execute method that is
http://www.codeproject.com/Articles/403323/SharePoint-2010-Create-Custom-Timer-Jobs
http://blogs.msdn.com/b/chriskeyser/archive/2010/12/20/using-a-sharepoint-timer-job-to-deploy-settings-in-a-farm-for-registering-event-sources.aspx
To store certain dynamic data we can use config file i.e. OWSTIMER.EXE.CONFIG that lies at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN.
http://doitwithsharepoint.blogspot.de/2011/03/config-file-for-sharepoint-custom-timer.html
What I am mentioning over here are few notes that help recapitulate the entire model once I have to redo it.
- Dubbuging a Timer Job: it yet another PITA. To do that you got to attach the assembly to the process OWSTIMER.EXE. Then you are required to run the job manually and you breakpoint will be hit.
- Resetting the SPTimer: Almost every deployment on the developerment machine requires the SPTimer Job to be restarted. For example from command promp one can restart timerJob using commands.
net stop SPTimerV4
net start SPTimerV4
- Its feature scope that freaks me sometimes out. Whether to keep it Site? Webapp? There is no wrong option actually but every choice comes with some consequecence
- After the deployment sometimes "Access denied." error can turn last nail in the coffin of your time esttimates.
There are two crutual parts of a timer job.
1. Feature recieve and feature activation method
2. Execute method that is
http://www.codeproject.com/Articles/403323/SharePoint-2010-Create-Custom-Timer-Jobs
http://blogs.msdn.com/b/chriskeyser/archive/2010/12/20/using-a-sharepoint-timer-job-to-deploy-settings-in-a-farm-for-registering-event-sources.aspx
To store certain dynamic data we can use config file i.e. OWSTIMER.EXE.CONFIG that lies at C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\BIN.
http://doitwithsharepoint.blogspot.de/2011/03/config-file-for-sharepoint-custom-timer.html
What I am mentioning over here are few notes that help recapitulate the entire model once I have to redo it.
Comments
Post a Comment