Archive for the ‘Development’ Category

Recently, I have been working with Database Projects within Visual Studio 2005 (yes, I’m set in my ways — I haven’t got around to VS2008 yet!!). I like the ability to source control my creation scripts and stored procedures and I’m happy to use the VS IDE to write my SQL code and running individual scripts against multiple development Database References is a breeze.

However, deploying the finished scripts to a production database is a bit of a nightmare. Essentially, if each script file represents a single database object, you have to ensure that you run them all in the correct order — especially if you have foreign key constraints (you do have foreign key constraints, don’t you?!). Ordering all these scripts manually is a royal pain.

After the second or third time of being stuck in this situation, I decided enough is enough and set about writing a small app to do the job for me. The results of this formed the mighty DependencyList.

We recently had a situation here where the opening of a .NET connection to an Oracle 10g database caused the entire database to crash. This was indicated by the Event Log entry:

The OracleService<SID> service terminated unexpectedly.
It has done this <n> time(s).
For more information, see Help and Support Center at
http://go.microsoft.com/fwlink/events.asp.

This was using some library code that we had developed and used successfully on numerous occasions, so it had us truly stumped.

After much soul-searching, one of my colleagues eventually narrowed it down to the length of the .NET project name. The project, when compiled, created a EXE file that had a really long name, which caused Oracle to shit bricks.

Wonderful. I hate how Oracle has such a problem with large object names.

Also, I’d love to know how an Oracle DBA would approach such a failure. How would it even be recorded? There are so many different log files in a standard Oracle installation that I really wonder where you might begin?

I was recently bugged by an error in a Windows Service I was developing that, when deployed an started, immediately stopped. My log files showed nothing, which suggested that the exception was happening before my logging and exception handlers started.

Not the most helpful of errors, but I could see the system.configuration entry, so I started with the theService.exe.config file, emptying the file of any meaningful data and adding it back in piece by piece until I recreated the error.

I realised that the appSetting contained an ampersand (&) witin its value, I realised that ampersand is a reserved character in XML and so the .NET configuration parser couldn’t validate the .config file.

To resolve this I replaced the ampersand with its XML-compliant counterpart (&amp;), so the key now read:

This is a quick pointer for anyone implementing a VirtualPathProvider in their ASP.NET applications. I’ve read a number of tutorials on VPPs but none really touched on this issue.

If you do not implement a method for VirtualPathProvider.GetFileHash(...), calls to this method will return null/Nothing.

If this happens, ASP.NET’s build/compile system doesn’t remember that it has already compiled the file and attempts to do so again. After 15 compiles, the AppDomain is unloaded and the application restarts. This can cause major irritation, particularly with performance, as the recompiles take time.

To get around it in my app, I am overriding GetFileHash to return a string concatenation of the VirtualFile’s name and Last Modified Date. If anyone knows of a better hash, then please let me know.