Last post Jun 21, 2013 04:57 PM by Spider.net
Jun 18, 2013 05:14 AM|kdxpfa|LINK
I have a ASMX WebService and I want to persist state information if recycles happen or the WebService is shut down / restarted.
I tried to use the Global.asax events Application_End for storing information to local file system and Application_Start for loading the stored information, but it seems that there is no guarantee about the order how the events are raised. It can happen
that Application_End isn't finished yet and Application_Start for the next run already gets executed. How to handle that? Is there a better way than Application_End for storing information for the next application run?
Jun 18, 2013 07:04 AM|sameer_khanjit|LINK
If you can you outproc session to persist state information.
Jun 18, 2013 07:07 AM|kdxpfa|LINK
thanks for your suggestion, but I don't really want to persist sessions. I have my own transaction logic implemented to handle file transfers (chunk-wise transfer), and want to persist open transactions.
Jun 19, 2013 01:50 AM|Haixia Xie - MSFT|LINK
You may check some references below to check if they help, implementing IExtension<T> or using caching.
#Where to store data for current WCF call? Is ThreadStatic safe?
#How do I store persistant data on a WCF Service?
#Caching With WCF Services
Jun 21, 2013 04:57 PM|Spider.net|LINK
One option is you can store session state in SQL server, if the server restart you can fetch the value from Database
Some of the useful link related to it