September 2009 Entries

Do Not Return True/False on a Transaction Success/Fail

Technorati Tags: C# There are many times in some shops I’ve worked where I’ve seen developers return a boolean back form a method for a transaction fail vs. succeed as a way to determine whether to do something next in code.  A transaction could be any type of work.  I talk about transaction here in a generic way; insert into a db, copying of a file to a directory, you name it.   Here’s an example: public bool DoSomething(int someID, ..., ...) ...

posted @ Friday, September 18, 2009 9:45 PM | Feedback (4)

Can’t See Recent Commits in Tortoise SVN Log

Technorati Tags: Subversion After restoring a backup repository today and then checking in some code to it, I noticed that the commit showed successful but when browsing the log I did not see it in there.  In fact no commits were showing. It ended up being the History cache.  The solution was to disable it and update the existing cache (who knows if there’s a quicker/easier way but this is just what I did in the spur of the moment). So uncheck the caching (I don’t really care about performance): Then I updated...

posted @ Friday, September 18, 2009 9:30 PM | Feedback (0)

Can't Open File txn-current-lock – Tortoise/Subversion

Technorati Tags: Subversion Today I had to restore a backed up repository.  I backup our entire C:\Repository on our dev server and simply copy it back to restore it as the server had crashed (don’t ask me why..I was not involved nor was there an image to just take and restore). Anyway, after I did, the repository version was perfect and up-to-date so we could carry on.  One error I did get initially after starting to use the restored repository was this when I tried to check in a test change: This simply happened...

posted @ Friday, September 18, 2009 9:21 PM | Feedback (0)

Quick Extension Method for Grabbing Exception.Data

Technorati Tags: C# This is nothing spectacular and exception methods are used all the time.  But thought to just post up for those of you who haven’t used them a lot.  Today I needed to check that Exception.Data is null.  If it was not, I wanted to then send a string.  First I added the data to the exception which is just the SOAP text that was sent via the HttpRequest that was used in a method that I called: XmlDocument doc = new XmlDocument(); ...

posted @ Friday, September 11, 2009 4:45 PM | Feedback (0)

Using Exception.Data to Append Extra Data to Your Exception

Technorati Tags: C# This is one of the rare times I’ve needed to append some data to an Exception.  And I really hadn’t used Exception.Data before.  So today was interesting.  I was tired of this third party API causing me inconsistent results when we call methods (because the API is not very reliable in the first place) so I wanted to log the SOAP request that’s being sent every time as part of any logging/debugging which is very useful when you only have just the .NET exception stack and really are missing the other piece of the puzzle, which...

posted @ Thursday, September 10, 2009 8:14 PM | Feedback (3)