The less-than-random ramblings of Scott Jackson, software architect.

No Such Comfort

(link) Why I use Tape Instead of Mocha & So Should You

Posted by scottj on April 13, 2017 in Custom Development, Debugging, Testing with No Comments


I must say I’m enjoying Node JS development. I’m starting to lose track of things though, so I need to be writing down my thoughts here. Right now, this is just a link to another blog regarding a Node JS test framework.

Why I use Tape Instead of Mocha & So Should You

Cleaning a Database

Posted by scottj on June 28, 2012 in Debugging with No Comments


When developing against SQL Server, sometimes scripts accidentally get run against the [MASTER] database.  I created the following script to drop all foreign keys, views and tables from a database.  It worked in my case, but be very careful with it.  It has two checks (called out in red) in there for tables that were not part of my solution, and they may not cover every case.  If someone knows how to refine this to exclude all sytem tables, I would appreciate them correcting this in the comments.  Thanks in advance.

select 'ALTER TABLE [' + c.TABLE_SCHEMA + '].[' + c.TABLE_NAME + ']'
  + ' DROP CONSTRAINT [' + c.CONSTRAINT_NAME + ']'
from information_schema.tables t
join information_schema.table_constraints c
 on t.table_catalog = c.table_catalog
 and t.table_schema = c.table_schema
 and t.table_name = c.table_name
where t.table_name not like 'MS%' and t.table_name not like 'spt_%'
 and c.constraint_type = 'foreign key'
union
select 'DROP TABLE [' + t.TABLE_SCHEMA + '].[' + t.TABLE_NAME + ']'
from information_schema.tables t
where t.table_name not like 'MS%'
 and t.table_name not like 'spt_%'
 and t.table_type = 'base table'
union
select 'DROP VIEW [' + t.TABLE_SCHEMA + '].[' + t.TABLE_NAME + ']'
from information_schema.tables t
where t.table_name not like 'MS%'
 and t.table_name not like 'spt_%'
 and t.table_type = 'view'

Debugging Timeout in IIS 7.0

Posted by scottj on January 11, 2012 in Debugging with No Comments


I’ve been working in SharePoint, and when debugging against my local IIS 7.0 instance, there is a 90-second page timeout.  If you’re not done with what you’re investigating at a breakpoint within 90 seconds, IIS will terminate the process hosting your code and dump you unceremoniously.

The tweak is quite easy though.  Open IIS Manager, find the appropriate app pool, right-click it and choose Advanced Settings.  In the Process section, turn Ping Enabled to false.

This will make your debugging sessions much more leisurely, as IIS won’t proactively terminate processes anymore.  You won’t want to leave it like that on a test or production server as that’s how IIS determines if a process has hung so that it can be restarted, but it’s great for your own develpoment environments.

.NET Data Services MERGE permissions

Posted by scottj on July 20, 2010 in Debugging with 1 Comment


With the help of a colleague and my client, we reproduced and diagnosed a permissions issue we were having with an elevation of a .NET Data Service from our development environment.  When executing MERGE queries through .NET Data Services, we would receive a 401.1 permissions denied error, and the update would fail.

The solution we found was that .NET Data Services appears to require file system Modify permission to the .svc file on the web server.  If the app pool user has modify permissions, the MERGE request succeeds.  If it does not, the request will fail as above.

Personally, I hope I find a better solution someday.  There is, in my opinion, no reason for the account my web service is hosted under to have permission to modify its source file.  Google, however, has failed me on this one; our searches haven’t found any relevant information yet.

Capricious Whim

“Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer.” —Fred Brooks