Archive

Archive for July, 2006

Parser Error Message: Access is denied

July 31, 2006 Leave a comment
This is one of those horrible asp.net error messages, when for no reason, you update some code with new code and you get an access is denied error.(*)
 
There are some sensible suggestions listed on msdn as to why this happens, and how it’s all down to indexer service – although, when you already have this service disabled, you’d wonder what’s up?
 
Basically, I went through these steps
Kill the asp_wp process
stop w3svc service
delete the bin folder
restart w3svc service, and go to offending page
stop the w3svc service
replace the bin folder with old files
restart the w3svc service.
 
It makes little sense why this works, but it worked for me.
 
 
(*) the specifics of the error (if you do view|Source) are
[FileLoadException]: Access is denied: ‘erc’.
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Boolean stringized, Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark)
   at System.Reflection.Assembly.Load(String assemblyString)
   at System.Web.UI.CompilationConfiguration.LoadAssemblies(Hashtable original)
[ConfigurationException]: Access is denied: ‘erc’. (c:winntmicrosoft.netframeworkv1.1.4322Configmachine.config line 258)
   at System.Web.UI.CompilationConfiguration.LoadAssemblies(Hashtable original)
   at System.Web.UI.TemplateParser.AppendConfigAssemblies()
   at System.Web.UI.TemplateParser.PrepareParse()
   at System.Web.UI.TemplateParser.Parse()
   at System.Web.UI.TemplateParser.GetParserCacheItemThroughCompilation()
   at System.Web.UI.TemplateParser.GetParserCacheItemInternal(Boolean fCreateIfNotFound)
   at System.Web.UI.TemplateParser.GetParserCacheItemWithNewConfigPath()
   at System.Web.UI.TemplateParser.GetParserCacheItem()
   at System.Web.UI.ApplicationFileParser.GetCompiledApplicationType(String inputFile, HttpContext context, ApplicationFileParser& parser)
   at System.Web.HttpApplicationFactory.CompileApplication(HttpContext context)
   at System.Web.HttpApplicationFactory.Init(HttpContext context)
   at System.Web.HttpApplicationFactory.GetApplicationInstance(HttpContext context)
   at System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr)
Categories: Uncategorized

Using DBCC to create fair performance tests on stored procedures

July 27, 2006 Leave a comment
When tweaking stored procedures, to make them run faster, we often compare them against a benchmark,
say SP_A vs SP_B.
 
However, if SP_A has been used actively, as part of a running system (i.e. website). it will be optimized by SQL server and will be placed in the procedural cache. This then results in Biased tests between SP_A and SP_B.
 
Therefore I would recommend using
DBCC FREEPROCCACHE
and
DBCC DROPCLEANBUFFERS
 
before timing the execution of SP_A against SP_B. Although, the affect of clearing the cache will cause them both to run slower, it will highlight performance gains of one against the other fairly.
 
 
 
Categories: Uncategorized

Full text catalog not populating on SQL server 2005

July 24, 2006 Leave a comment
I had a problem with a full text catalog stopping at a particular point, and not populating further,
 
To diagnose, problems like this, open C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOG
 
where I saw, Could not allocate space for object ‘sys.fulltext_index_map_1813581499’.’i2′ in database ‘CFGlobal’ because the ‘PRIMARY’ filegroup is full. Create disk space by deleting unneeded files, dropping objects in the filegroup, adding additional files to the filegroup, or setting autogrowth on for existing files in the filegroup.
Therefore I just increased the space allocated to the primary filegroup, and it kicked off again.
 
Categories: Uncategorized

IFrames and the back button

July 11, 2006 Leave a comment
If you have an Iframe on a page, and you press the back button, then oftentimes, only the Iframe goes back in it’s history, not the containing page.
 
There are a few workarounds for this, this is just a proposal, if it helps…
 
firstly, if you have a pre-loader on the iframe, such as…
 
graph.contentWindow.document.write(‘Please wait…’);
graph.src = ‘someurl’
 
when you can poll the Iframe for a change in the "Please wait message". (Note, that the url that you are redirecting to must be on the same domain as the parent page, or else you get a security exception)
 
// 951 – back button fix. 
 var wasGraphLoaded = false;
 setTimeout(‘checkGraph()’,500);
 function checkGraph()
 {
  if (imgGraph.document.body.innerHTML.indexOf("…")==-1)
  {
   // Graph must be loaded…
   wasGraphLoaded = true;  
   
  }
  else
  {
   // Graph isn’t loaded.
   if (wasGraphLoaded)
   {
    // The back button bust have been pressed
    window.history.go(-1);
   }
  }
  setTimeout(‘checkGraph()’,500);
 }
Categories: Uncategorized