Monday, 11 August 2008

PlanSmart - A SQL Plan Visualiser with a shonky name



As a personal project, I've been playing with Linq and WPF etc in a little app for automating some of the work I do manually when I'm diagnosing slow SQL queries in my day job.

It's reached a point where I think it actually adds some value over and above the stock Enterprise Manager/SSMS experience, and I've had enough people take an interest in it that I've decided to throw it up online, where anyone can make use of it.

It's a first for me in a lot of ways, so I don't believe the code is of a quality I'd put my name to by open-sourcing it, but it is available for free.

Grab it here if you're keen.

Tuesday, 5 August 2008

Can't request two ASPX pages at once??

So we have some big reports in our app. Not huge, but big enough they take a couple of minutes to run.

Once we gather the parameters for the reports, we whack 'em away into the database (for auditing etc), and grab a ReportRequestID, a unique value for that run.

The requestId is jammed into session, and we window.open() our report viewer page, which grabs the ID, and runs the report for that ID.

Some clever cookie (a tester of all people) decided not to stare idly at the report screen, but to continue using the application in the background... the only problem is the postback doesn't happen until the report completes!! We don't even hit a breakpoint in Application_AcquireRequestState.

Have we hit the 2 requests per server http limitation? Fiddler says no.

Turns out the session in ASP.Net gets locked on a per user basis, for the entirety of the request...
We have the luxury of rolling over to Query String param passing instead, but heaven help us if we legitimately need 2 session enabled requests at once in the future.