I have an asp.net application running in a server farm. So In-proc sessions are out. There's no state server. There's a sql server database (can't be used for state server). There's no forcing same web server serving capabilities so no guarantee which web server will serve next page.
I need to save a block of data (big object state) between pages. I don't want to use viewstate because data could be large and don't want it to go across the wire. I could use the database to save the data and use the record id across the wire in a viewstate and retrieve the data for the next page.
Are there better solutions?
I could use the database to save the data and use the record id across the wire in a viewstate and retrieve the data for the next page.
You've eliminated every other option.
Well, I guess you've ruled out most options already. And assuming you cannot install other services, two other possibilities come to mind:
As in the SQL Server version, don't forget to clean up your data somehow; option 1 is pretty similar to SQL Server in that regard, but in case of SQL Server it could simply be a centralized cleanup job, in the file share case the question becomes: which server is the center?
*) You could, of course, try to spawn a secondary process from ASP.NET. The problem here becomes: what if that process has problems? It's not manageable for your sysadmins by default, unless you make it manageable.
I'm not sure if I read right, but can you not use the database to store the asp.net session?
<sessionState
mode="SQLServer"
sqlConnectionString="somedb"
cookieless="AutoDetect"
timeout="20"
/>
You could also use some sort of distributed caching solution like memcached(http://www.danga.com/memcached/ and that could persist the data between postbacks.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.