XP, Component Services and .NET

Transactions

Configurable Isolation Levels for Transactions

The new TxIsolationLevel property or the Component Services administrative tool can be used by COM+ developers to configure an application's isolation level according to need, helping to increase concurrency, performance, and scalability. This flexibility allows those with the right amount of expertise to get every ounce of throughput out of their applications. COM+ 1.0 is very moderate concerning transaction isolation. It allows only serialized transaction, which is the highest level of isolation. With serialized transactions, the results obtained from a set of concurrent transactions are identical to the results obtained by running each transaction serially. Such a high degree of isolation comes at the expense of overall system throughput because the resource managers involved have to hold on to both read and write locks for as long as a transaction is in progress, and during this time all other transactions are blocked.

On the other hand, there are particular issues where you may require dealing system reliability for decreasing the isolation level as a whole. One of the supplies of an ATM system (Automatic Teller Machine) is to retrieve the total amount of money in all customer accounts collective. While it is possible to execute that transaction with the serialized isolation level, if the bank has hundreds of thousands of accounts use these ATMs, it may take a few times to complete. The transaction might timeout and abort because some accounts are being accessed by other transactions at the same time. However, the quantity of accounts may be an approval in practice. Overall, when we consider it statistically, if the transaction is permitted to run at a lower transaction level, it may get the wrong balance on some accounts, but those incorrect balances would tend to cancel each other out. The actual resulting error may be acceptable for the bank's need.

Under COM+ 1.5 you are able to configure the isolation level for a transactional component. The Transactions tab has a dropdown listbox with five isolation levels. The available isolation levels are Any, Read Uncommitted, Read Committed, Repeatable Read, and Serialized. As you will see in box default, isolation level is Serialized.

Service Activation Type

New COM services allow you to configure a server application to operate as a system service. With this feature you are able to have your application running immediately after the computer boots, independent from client activation requests. One more advantage is that a service application is the only way to have the application operates under the system identity account. The system account is the very robust account on a known computer.

You may see on application Activation tab that it contains the checkbox "Run application as NT Service”. Once you click on it, you can also configure the different service parameters by clicking the Setup New Service button, saving you the difficulty of using the control panel services applet.

Process Dumping and Application Dump

Troubleshooting is not an uncomplicated application in an assembly situation. How do you collect information on a difficulty without disconcerting the running processes? COM+ now gives a clarification during process dump feature. This characteristic lets the developer to dump the complete state of a process without terminating it. To debug and analysis purposes, it is sometimes useful to get a complete memory dump of an application, especially at the time of a crash. COM+ 1.5 brings a future that you can configure a dump of a static memory image of the process hosting your COM+ application. You can use a utility such as WinDbg to view and analyze this image.
All COM+ 1.5 applications have a new tab on its properties page called Dump. You can give a location for the image dump and the amount of images to keep there. When the maximum number of images is reached, a fresh dump image overwrites the oldest one. The limit number of images you can have COM+ 1.5 keep for you is 200.

There are several methods to generate a dump file. Categorizing COM+ to dump a memory image on application fault is the main method. An application's fault in this context is when an exception is thrown. The second method is to select Dump from a running application's context menu. Finally, you can also directly ask for a dump using the DumpProcess method of the ICOMAdminCatalog2 interface, defined as:

[id(0x1f)] HRESULT DumpProcess([in] BSTR bstrApplicationInstanceId,
[in] BSTR bstrDirectoryName,
[in] long lMaximumImages,
[out,retval] BSTR* pbstrDumpToFile);

COM+ 1.5 Catalog root object supports ICOMAdminCatalog2 which derives from the COM+ 1.0. After you use the DumpProcess method, you need to give the dump directory and file name, and you cannot rely on the configured values. Asking for a dump on a running application is not invasive and the process can keep on running, and is only inactive temporarily for the period of the dump.

Once COM+ creates a dumped file, it uses the subsequent naming convention as a file name so that you can simply connect a dump file with a reported system failure. To stay away from unnecessary calling DumpProcess, ICOMAdminCatalog2 has an aid technique called IsProcessDumpSupported that is used to discover whether image dump is enabled on the computer.

Enhanced Context Activation Settings

COM+ 1.0 lets you to configure your component to use JIT activation. In addition, configuring it requires that the component be activated always in its creator's context by checking the checkbox "Must be activated in caller's context" on the component properties page on the Activation tab. This means configuring your component to use Just-in-Time (JIT) activation needs to have its own context. These two settings are commonly limited. If you configure a component like that, all activations will fail. You deal with a similar risk when configuring the component to use transactions or enforce security access checks for the component—all require a private context. The COM+ 1.5 Explorer has a solution for this situation. It includes a redesign of the component Activation tab as well as a new activation option.

The Activation Context properties group contains three radio buttons. You can only select one button at a time. This enforces common exclusion. If you select "Don't force activation context," you actually choose the regular COM+ context activation activities. In this method, you can enable JIT activation, transactions, and security access checks. In fact, as long as transaction support or access security are enabled, you cannot even select another option, and enabling security checks sets the selection back to "Don't force activation context" from any other setting.

New COM services added a new context activation selection called "Must be activated in the default context." When you know that clients of the component reside in the default context, and they are making frequent calls of short duration to your component, and that your component does not use almost all of COM+ services this new option can be useful.

You might also like...

Comments

About the author

John Godel United States

John H. GODEL has an experience more than 22 years in the area of software development. He is a software engineer and architect. His interests include object-oriented and distributed computin...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Java is to JavaScript what Car is to Carpet.” - Chris Heilmann