Thursday, November 29, 2012

When do you stop for UX in SCRUM?

I've been struggling with the question of integrating User Experience (UX) into our release cycle. Here is an article that suggests a pretty good solution: Fitting Big-Picture UX Into Agile Development

Tuesday, November 27, 2012

See what your SQL Queries are costing you

Here is a neat script that will tell you what the most costly queries are on your SQL Server:


SELECT  creation_time 
        ,last_execution_time
        ,total_physical_reads
        ,total_logical_reads 
        ,total_logical_writes
        , execution_count
        , total_worker_time
        , total_elapsed_time
        , total_elapsed_time / execution_count avg_elapsed_time
        ,CAST('' AS XML) AS statement_text
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
ORDER BY total_elapsed_time / execution_count DESC;

Tuesday, October 16, 2012

FIXED: "Invalid type owner for DynamicMethod" error in Nhibernate

If you recieve the "Invalid type owner for DynamicMethod" error while initializing you NHibernate SessionFactory then it's pretty likely that you are using generic methods on some of your lazy loaded/proxied classes.

Nhibernate incorporates a reflection optimization that speeds up the creation of proxy classes. This reflection optimization does not play well with generics. The error it throws is "Invalid type owner for DynamicMethod". Not very friendly.

So, to fix this you must either stop using generic methods OR turn off the optimization. To turn off the optimization you must run the following code before you initialize your SessionFactory.

NHibernate.Cfg.Environment.UseReflectionOptimizer = false;