MsCorEE

JeffGonzalez : IScalable

September 2003 - Posts

SpamAssassin and SAProxy freaking own!

This tool is absolutely awesome.

 

SAProxy Information
http://saproxy.bloomba.com/moreinfo.php

 

Download
http://saproxy.bloomba.com/community.php

Asp.Net Error Handling Part Deux

I was reading on ISerializable's weblog regarding error handling in asp.net and I thought I would describe the method I used at work.  When I was at TechEd this year, I heard something interesting that got me thinking.  I cannot remember which speaker said it, but what they said was “You should never write to a file, database, log, etc... for an exception, exceptions should be handled asynchronously and should be fire and forget.“  This way the user is never waiting for a response, you can very quickly display an error page, and deal with logging the error later.  As soon as I got back to work, I started implementing a message queue system to handle exceptions.  I used the ExceptionManagement Application Block as the starting point.  I had to implement a custom publisher to send the exception to the message queue.  I added a context information class so that I could track the state of the current exception.  For windows applications it attaches things like ThreadIdentity, WindowsIdentity, MachineName, etc to the exception.  For Web applications it adds Request.Form, Request.QueryString, Request.Cookies, and ServerVariables.  All of the code I need to log an exception is noted below.

protected void Application_Error(Object sender, EventArgs e)
{
        Exception ex = Server.GetLastError();
        ExceptionContextInformation ctxInformation = new ExceptionContextInformation(applicationName, HttpContext.Current);
        ExceptionManager.Publish(ex, ctxInformation);
}

This fires the MessageQueuePublisher custom publisher that I wrote.  From there I wrote a windows service to “drain“ or process the messages from the queue and process them accordingly.  We usually just stuff all exceptions into a database and use business logic in our Error Notification application to handle the notifications.

 

Role Based Security discussion

I have been debating with some colleagues from work over the merits of role based security in the .NET Framework.  I have written an article about it at the url below.  I am greatly interested in the thoughts of the community on this challenging problem. 

http://weblogs.asp.net/jgonzalez/posts/28168.aspx

Stealing is wrong and a 2 way street

I agree stealing copyrighted material without properly compensating the author/publisher is wrong.  I have used Napster/Gnutella/Morpheus to reclaim the albums that I have been either lost, stolen or “borrowed and never returned”.  Actually I'd say that I have downloaded more songs for albums or cd's that in the past I would have had to purchase again, had I not been able to download them.  Is this moral....?

MoralityPermission permission = new MoralityPermission (“Jgonzalez“,“ReclaimLostMusic“);
try
{
    permission.Demand();
    DownloadMusicIAlreadyOwnedButWasLostOrStolen();
}
catch (SecurityException sEx)
{
    //put Get a Rope code here
}

I also think it is a crime to charge 20 dollars per CD, but no one seems to be complaining about that.  What is the REAL difference between recording a single played 30 times a day off the radio, and downloading the single off the internet.  I never intended to buy the artists whole album, because honestly, the whole album sucked. 

Now before everyone goes and gets all veklempt about this I would like to say...  I will be using BuyMusic for all of my online downloading music transactions.  Even if it a bit unfair to have to pay for music THAT I ALREADY PURCHASED A CD FOR.

Figured I'd jump on the Myers-Briggs bandwagon
Your Type is
INTP
Introverted Intuitive Thinking Perceiving
Strength of the preferences %
33 33 44 11

 You are:
  • moderately expressed introvert
  • moderately expressed intuitive personality
  • moderately expressed thinking personality
  • slightly expressed perceiving personality

Edit: Whoops I copied someone else's result by mistake, corrected now.

Why System.Windows.Forms.ImageList being sealed is a good idea.

http://www.ingorammer.com/Articles/SealedIsGood.html

More Posts