There are two methods of deploying transactional components: you can either deploy them using the Transaction Server Explorer or you can deploy them in a more automated fashion using Microsoft Visual InterDev 6.0. As we learned in Chapter 18, remote deployment for middle-tier COM server components is one of the exciting new features in Visual InterDev 6.0.
In this section, you'll learn how to perform both of these procedures. It's important to understand both techniques. Since Visual InterDev 6.0 allows you to remotely deploy these components from your workstation, you might want to modify some of the properties of your packages and components. These types of configuration operations can be performed only by using the Transaction Server Explorer.
Using the Transaction Server Explorer to deploy a transactional component requires that you first create a package and then install the component into that package. You'll also need to configure various properties of the package and its components.
First access the Transaction Server Explorer by choosing Start|Programs|Windows NT 4.0 Option Pack|Microsoft Transaction Server|Transaction Server Explorer or by choosing Start|Programs|Windows NT 4.0 Option Pack|Microsoft Internet Information Server|Internet Service Manager. Both of these options will launch the Microsoft Management Console. The following steps illustrate how to create a package:
You should now see an icon representing your new package under the Packages Installed folder.
Figure 20-6. The Package Wizard allows you either to create an empty package or to install prebuilt packages.
If you want to adjust any of the properties of your package, simply right-click the package and choose Properties to bring up the Properties dialog box. This dialog box has five tab folders for configuring the general, security, advanced, identity, and activation properties.
On the General tab, you can change the name of the package and add a description. On the Security tab, you can enable authorization checking and specify the authentication level for calls. The Advanced tab allows you to specify how the server process should be shut down. You can either keep the process running when idle or have the process shut down after a certain number of minutes of inactivity.
NOTE
When developing and testing your components, it's worth setting the value on the Advanced tab to 1 minute so that the process is shut down quickly after execution. This will enable you to compile other versions of the component and stage them within MTS without having to wait as long for the process to shut down.
The Identity tab is used to specify which account the process will run under. This can either be the currently logged on user or another Microsoft Windows NT user account that you specify. Finally, the Activation tab allows you to choose the activation type for your package. This can either be a library package or a server package. Server packages are recommended because they allow the component to be activated in a dedicated server process.
Now that you have created your package, you can install your component. The following steps illustrate how to achieve this:
After installing the component, you'll need to configure the properties of the component. The following steps show how to achieve this:
Figure 20-7. The General tab of the Properties dialog box for a component within the Transaction Server Explorer.
Your component is now ready for use! Figure 20-7 shows the General tab in the Properties dialog box. Here you'll notice the name of the DLL is listed as well as the CLSID and the package name. The CLSID is the component's class ID. This is the universally unique identifier (UUID) that identifies the component. The CLSID is stored in the Windows Registry. Figure 20-8 shows the Transaction tab of the Properties dialog box.
Figure 20-8. The Transaction tab of the Properties dialog box for a component within the Transaction Server Explorer.
Figure 20-9 shows the Transaction Server Explorer after we have created a package named MTS Example, installed components named mtsexample.ASP and mtsexample.transaction (both part of the mtsexample.dll ActiveX component that we created earlier), and added an Administrator role and associated users to the package.
Figure 20-9. The Transaction Server Explorer showing the components and roles that have been set up for the MTS Example package.
Now that we've seen how to deploy a component using the Transaction Server Explorer, let's take a look at the equivalent operation within Visual InterDev 6.0. The first step is to add your component to a Web project. The following steps show how to achieve this:
Your component will now be added to your Web project.
Now that the component has been added to your Web project, you are ready to install it in Microsoft Transaction Server. You can do so by following these steps:
Figure 20-10. The Component Installation tab of the component Properties dialog box within Visual InterDev 6.0.
When you enter a package name, you can either enter the name of an existing package within MTS or you can specify a new package and have Visual InterDev request MTS to create it for you. You'll remember from the discussion of transactional ASP in Chapter 19 that there are four available options for specifying transaction support. Table 20-1 summarizes these options.
Table 20-1. Transaction support options available on the Component Installation tab of the component Properties dialog box within Visual InterDev 6.0.
Option | Action |
---|---|
Requires A Transaction | Set the component's objects to execute within the scope of a transaction regardless of whether the client has a transaction. |
Requires A New Transaction | Create a new transaction for the component's objects to execute within regardless of whether the client has a transaction. |
Supports Transactions | Set the component's objects to execute within the scope of the client's transaction. |
Does Not Support Transactions | Set the component's objects to run without a transaction regardless of whether the client has a transaction. |
After you select OK, the component will be registered on the server and will be added into MTS under the appropriate package with the appropriate transaction support option that you specified. You'll be able to see the sequence of events by watching the status bar in the lower left-hand corner of the screen.