alterm4nn/ChronoZoom — pull request #600 by javierluraschi (2013-06-09 06:16:24+00:00)
Title: Fix #596: ChronoZoom Production Environment Outage

Production Outage Exception: https://github.com/alterm4nn/ChronoZoom/issues/596
Code Review (Approved): http://mrccodereview.cloudapp.net/ui#review:id=1244

Three different problems caused this outage:

a) Production hit a bug in entity framework that triggers only when the connection timeout is low (a previous check-in fixed this already) See http://forums.asp.net/p/1630696/4200869.aspx/1?Re+Sometimes+System+InvalidOperationException+occurs+when+calling+Entity+ToList+Method

b) WCF REST API instantiates a single Storage object for all the API operation which made the bug sticky across all sessions. This also explains why triggering the website reset fixed the issue. The resolution is to follow the Entity Framework best practices and instantiate an object per operation. See http://msdn.microsoft.com/en-US/data/jj613941

c) Production was running with only one instance; this uncovered that we are hosted in the wrong subscription. Fixing by Monday 6/10.

Changes in this pull-request:
- The main change is on Chronozoom.svc.cs. to refactor the API code to use different Storage instances.
- Fixed bugs related with authoring from progressive load regressions.
- Centralized collection-authentication code in Chronozoom.svc.cs.
- Prevented exceptions from being thrown while generating collections page. During the outage, navigating to /sandbox/ threw an exception page. Instead, this will load the page and return a JSON error.
- Added unit test to verify dynamic page generation.
- Renamed Entities.UnitTest to Entities.UnitTests to be consistent with UI.UnitTests.
- Made internals visible to unit tests projects to facilitate testing.
- Removed couple unnecessary files.