Natty Gur

Enterprise Architect on Enterprise Architecture

  • Using COM+ as Isolation level for IIS 5 hosting multiple applications

    I know its quit controversy but when I need to host many web application on single machine running IIS 5.0 (usually for consolidation reason) and I want to keep the server availability as near as possible to 24*7 I use COM+. To be more specific I ensure that all the application classes, except the visualization layer class, will run under COM+ Server Application. I don’t mean that all the classes will be registered as COM+ server but will run under the COM+ server dllhost dedicate process. The easiest way to achieve this rule is by applying a Façade design pattern and to register just the façade class as COM+ server. This way all the calling classes by the façade will be run under COM+ server but won't register as COM+ server. Yes I know COM+ hurt performance quit badly but if you willing to accept it you get much more reliable server. Every web application is running in dedicated application domain. But if for some reason one application causes aspnet_wp process to reach 100% CPU (and its happened), that application causes all other application to misbehave. But if the misbehaved application cause any problem when the application code is running under dllhost process not just that the aspnet_wp process keep on going, restarting the dllhost process cause the misbehave application to continue working as usual. In addition using COM+ statistics can help you find quickly the misbehave component and to focus more quickly on the buggy class.

  • Back to COM and ADO.

    It’s all about COM component that scrabbles given string and insert the results into oracle DB. That component is working for a 6 month but for time to time the results that stored in the DB found corrupted when tried to re-scrabble by other application. The guys that wrote that component try to find out what the reason for this unexpected behavior without any success they saw that they writing ASCII values to the DB but for some reason the values that saved in DB didn’t match the send values. Further study found out that the oracle driver – ORAOLEDB, for some reason, don’t like values between 0xC0 – 0xCD and always replaces them with 0x63. The only workaround that we found is to use Microsoft provider MSDAORA. MSDAORA doesn’t seem to have this problem.

  • Problems using Installutil to install window service.

    It's the second time I see this behavior so I thing it worth publishing. Well all of the sudden using Installutil on service failed with an error about the Reflection, that don’t find any Installer type in assembly. This service already installed several times with Installutil without any problem so it's obvious (and I check it) that my assembly contain installer type. It's cleat that the service not already installed as service.

  • Windows Client Printer Driver

    Today I play with “Windows Client Printer Driver”. This printer come with longhorn but you need to explicitly set it to be install or to use add windows component to install it. The printer can be use from win32 or Avalon programs and produce Avalon fixed-format document. To check it up I create word document with images embedded into the text and choose Windows Client Printer Driver as the active printer. The result was Avalon container that displays the text and graphics, exactly as I place them on the word document with all the benefits that Avalon supply. Nice J

  • Successful using of windows custom and user controls embedded into WEB pages to show link analysis.

    Just finish today custom control that use GDI+ to show link analysis outcome in several visualization forms (circle, segmentation, hierarchic, etc'). We need to show about 1000 nodes * 1000 links and all the commercial tools that we check (such as tom sawyer) failed to do it in less then 2 second. Eventually we found out that using GDI+ result in sufficient response time. Yes, its enterprise application and all the clients got .Net framework installed on them.

  • If your clients use just IE 5+ (usually enterprise application) use GZIP to reduce network traffic.

    Internet explorer from version 5+ can recognize GZIP encoding streams, open them and render the "unziped" HTML. So if all of your clients use just IE 5+ you can take advantage of this ability to reduce network traffic. This practice is very usable for national spread organization that include sites with low bandwidth lines (GZIP can reduce stream size up to 10 times). To use this ability you need to ZIP all streams  leaving your IIS server. HttpModules save our day by enable us to track down every outgoing response. Ben Lowery (our hero) create HTTPModule that Zip every outgoing request from the server. You can download the module with source code, explanations and sample from Bens site :  http://www.blowery.org/code/HttpCompressionModule_1.1.zip 

  • Don’t forget to use ServicedComponent.DisposeObject.

    Recently I receive calls about .Net objects registered in COM+ that are working randomly. In all cases it was eventually all about programmers that use objects that derived from ServicedComponent but forgot to use ServicedComponent.DisposeObject when they finished working with those objects. If you won't use this function COM+ won't release object and eventually you will end up with hundreds of objects that cause object misbehave.