Persisting state in Sharepoint timer job definitions

Using class member variables will not work if you want to persist state between invocations. This seems to be due to the way sharepoint manages timer jobs. A solution is to use the Properties *property* which is exposed to all SPJobDefinition subtypes. This is a hashtable which accepts a key value pair. Usage:

public class SampleTimerJob : SPJobDefinition {     public SampleTimerJob(string jobName, SPWebApplication webApplication, string url, string email)         : base(jobName, webApplication, null, SPJobLockType.ContentDatabase)     {         ContainerSite = url;         Email = email;          this.Title = “sample timer”;     }      public string ContainerSite     {         get { return Properties[“site”].ToString(); }         set { Properties[“site”] = value; }     }      public string Email     {         get { return Properties[“email”].ToString(); }         set { Properties[“email”] = value; }     }      public override void Execute(Guid targetInstanceId)     {         SPSite site = new SPSite(ContainerSite);          using (SPWeb web = site.OpenWeb())         {              SPUtility.SendEmail(web, false, false, Email,                                 “title”,                                 “content”);         }     } }

27 Replies to “Persisting state in Sharepoint timer job definitions”

  1. Hello, of course I came to visit your site and thanks for letting me know about it. I just read this post and wanted to say it is full of number one resources. Some I am familiar with. For those who don’t know these other sites they are in for a treat as there is a lot to learn there.

  2. ?????????? ????? ?????????? ??????, ?? ??????? ?? ??????????? ??????? ?????? ??? ?????????? ? ???????? ???? ??????????. ??? ?????????? ????????? ?? ???????? ? ???????????. ? ??? ?????? ???? ???!

  3. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]rder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]oder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orer viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]ordr viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orde viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order iagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vigra href=”http://www.carroll.edu/boards/member.php?u=12593″]order viara href=”http://www.carroll.edu/boards/member.php?u=12593″]order viaga href=”http://www.carroll.edu/boards/member.php?u=12593″]order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  4. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]rder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]oder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orer viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]ordr viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orde viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order iagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vigra href=”http://www.carroll.edu/boards/member.php?u=12593″]order viara href=”http://www.carroll.edu/boards/member.php?u=12593″]order viaga href=”http://www.carroll.edu/boards/member.php?u=12593″]order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  5. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]rder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]oder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orer viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]ordr viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orde viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order iagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vigra href=”http://www.carroll.edu/boards/member.php?u=12593″]order viara href=”http://www.carroll.edu/boards/member.php?u=12593″]order viaga href=”http://www.carroll.edu/boards/member.php?u=12593″]order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  6. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]rder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]oder viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orer viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]ordr viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]orde viagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order iagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vagra href=”http://www.carroll.edu/boards/member.php?u=12593″]order vigra href=”http://www.carroll.edu/boards/member.php?u=12593″]order viara href=”http://www.carroll.edu/boards/member.php?u=12593″]order viaga href=”http://www.carroll.edu/boards/member.php?u=12593″]order viagr href=”http://www.carroll.edu/boards/member.php?u=12593″]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  7. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://world-viagra.com”]rder viagra href=”http://world-viagra.com”]oder viagra href=”http://world-viagra.com”]orer viagra href=”http://world-viagra.com”]ordr viagra href=”http://world-viagra.com”]orde viagra href=”http://world-viagra.com”]order iagra href=”http://world-viagra.com”]order vagra href=”http://world-viagra.com”]order vigra href=”http://world-viagra.com”]order viara href=”http://world-viagra.com”]order viaga href=”http://world-viagra.com”]order viagr href=”http://world-viagra.com”]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  8. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://world-viagra.com”]rder viagra href=”http://world-viagra.com”]oder viagra href=”http://world-viagra.com”]orer viagra href=”http://world-viagra.com”]ordr viagra href=”http://world-viagra.com”]orde viagra href=”http://world-viagra.com”]order iagra href=”http://world-viagra.com”]order vagra href=”http://world-viagra.com”]order vigra href=”http://world-viagra.com”]order viara href=”http://world-viagra.com”]order viaga href=”http://world-viagra.com”]order viagr href=”http://world-viagra.com”]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  9. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://world-viagra.com”]rder viagra href=”http://world-viagra.com”]oder viagra href=”http://world-viagra.com”]orer viagra href=”http://world-viagra.com”]ordr viagra href=”http://world-viagra.com”]orde viagra href=”http://world-viagra.com”]order iagra href=”http://world-viagra.com”]order vagra href=”http://world-viagra.com”]order vigra href=”http://world-viagra.com”]order viara href=”http://world-viagra.com”]order viaga href=”http://world-viagra.com”]order viagr href=”http://world-viagra.com”]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  10. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://world-viagra.com”]rder viagra href=”http://world-viagra.com”]oder viagra href=”http://world-viagra.com”]orer viagra href=”http://world-viagra.com”]ordr viagra href=”http://world-viagra.com”]orde viagra href=”http://world-viagra.com”]order iagra href=”http://world-viagra.com”]order vagra href=”http://world-viagra.com”]order vigra href=”http://world-viagra.com”]order viara href=”http://world-viagra.com”]order viaga href=”http://world-viagra.com”]order viagr href=”http://world-viagra.com”]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  11. uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr href=”http://world-viagra.com”]rder viagra href=”http://world-viagra.com”]oder viagra href=”http://world-viagra.com”]orer viagra href=”http://world-viagra.com”]ordr viagra href=”http://world-viagra.com”]orde viagra href=”http://world-viagra.com”]order iagra href=”http://world-viagra.com”]order vagra href=”http://world-viagra.com”]order vigra href=”http://world-viagra.com”]order viara href=”http://world-viagra.com”]order viaga href=”http://world-viagra.com”]order viagr href=”http://world-viagra.com”]femal version of viagra uy viagra by viagra bu viagra buy iagra buy vagra buy vigra buy viara buy viaga buy viagr rder viagra oder viagra orer viagra ordr viagra orde viagra order iagra order vagra order vigra order viara order viaga order viagr

  12. This does not seem to be true according to our experiments. We have gotten jobs to successfully serialize and deserialize member data. We had to tag each member variable that we wanted serialized with “[Persisted]”. After that it worked fine.

Leave a Reply

Your email address will not be published. Required fields are marked *