Make your own free website on Tripod.com

Chapter 6 Notes

 

Home Purchase Preface Contents Examples Resources Errata Site Guide

 COM and CORBAŽ Side by Side

Before you attempt to run the examples, make sure that you have properly configured your environment.

Click here for information related to the configuration that I used on my computers.

Click here for an overview of the Chapter 6 examples.

Chapter 6 covers a wide range of topics. This page breaks the areas into:

bulletMTS Transactions Example
bulletDCOM Security Example
bulletMTS Security Example
bulletMSMQ Example
  

MTS Transactions Example

Building the Example

To build the examples, run the _make.bat file in each of the following directories. Note that the order in which the examples are built is important.

bulletbook\ch06\mts_example\account
bulletbook\ch06\mts_example\teller
bulletbook\ch06\mts_example\client
 

Database Setup

To demonstrate the distributed transaction, you will need to create two SQL server databases. You should name these two distinct databases as follows:

bullet SQL Server DB: RDBMS_A
bullet SQL Server DB: RDBMS_B

The schema for each of these databases is as follows:

bullet Table: Account
bullet Fields:
bulletname varchar 32 nonulls
bullet balance real nonulls default 0.0

After you have created the databases, create the following rows in the Account tables:

bulletRDBMS_A: name: 'A' balance: 25.00
bulletRDBMS_B: name: 'B' balance: 45.00

The MTS account object will need access to the following ODBC data sources:

bullet ODBC data source: "RDBMS_A"
bullet ODBC data source: "RDBMS_B"
  

Configuring MTS

Start the MTS Explorer (MMC) and do the following:

bulletCreate an MTS package named "Ch6" (the actual name can be of your own choosing).
bullet Add Ch6Account.dll and Ch6Teller.dll to Ch6 package.
bullet Change the properties of Ch6.Account.1 and Ch6.Teller.1 so that they both require a transaction.
bullet Make sure to disable authorization checking on the security tab for Ch6 package when running these examples to avoid additional security work that would otherwise be required.
  

Running the Example

To run the client application, execute the _run.bat file located in:

bulletbook\ch06\mts_example\client
 

Remarks

bulletThe MTS account component assumes that mdac has been run
  
bulletThe MTS account component assumes that ADO is located in "c:\Progra~1\Common~1\System\ado". An import directive assumes this directory location when importing msado15.dll as a type library.
  

DCOM Security Example

Building the Example

To build the examples, run the _make.bat file in each of the following directories. Note that the order in which the examples are built is important.

bulletbook\ch06\com_security\com_agent
bulletbook\ch06\com_security\com_agent\ProxyStub
bulletbook\ch06\com_security\com_client
 

Running the Example

To run the client application, execute the _run.bat file located in:

bulletbook\ch06\com_security\client
 

Remarks

bulletTo better understand how impersonation works, you should set up the com_agent COM server to run under a different identity. This is accomplished by using dcomcnfg.exe.
 
bulletTo better understand DCOM security, this example should be tested across two machines to demonstrate packet privacy (packet privacy does not come into play when running the client and server on the same machine).
  
bullet Make sure to install both both client and proxy-stub DLL on separate machine from the server.
  
bullet Note that although the COM interface could rely on type-library marshaling, a proxy-stub DLL is used because of a bug with security. This bug was a problem using VC++ 5.0 and NT SP3.
  

MTS Security Example

Building the Example

To build the examples, run the _make.bat file in each of the following directories. Note that the order in which the examples are built is important.

bulletbook\ch06\com_security\mts_secure_account
bulletbook\ch06\com_security\mts_secure_client
   

Configuring MTS

Start the MTS Explorer (MMC) and do the following:

bulletCreate an MTS package named "Ch6" (the actual name can be of your own choosing).
bullet Add MtsSecureAccount.dll to the Ch6 package.
bulletCreate "Savers" and "Spenders" roles in Ch6 package.
bullet Add appropriate users to "Users" of "Savers" or "Spenders" role.
bullet Add appropriate roles to "Role Membership" of Ch6.MtsSecureAccount component.
bullet Make sure to "shut down" the MTS package whenever it is changed to make sure that it picks up new settings.
  

Running the Example

To run the client application, execute the _run.bat file located in:

bulletbook\ch06\com_security\mts_secure_client
  

Remarks

bullet Make sure to rebuild the client whenever the server is reinstalled. Depending on the compatibility mode used in the server project, VB likes to change the GUIDs after every recompile.
  

MSMQ Example

Building the Example

To build the examples, run the _make.bat file in each of the following directories.

bulletbook\ch06\msmq_example\market
bulletbook\ch06\msmq_example\trader
    

Running the Example

To run the market and trader applications, execute the _run.bat file located in:

bulletbook\ch06\msmq_example\market
bulletbook\ch06\msmq_example\trader
    

Remarks

bulletMSMQ must be installed on all machines where the market and trader applications are run.
  
bulletNote that the market and trader applications are hardwired to use "scarpia" as the MSMQ queue host.
 

 

Home ] Up ] Purchase ] Preface ] Contents ] Resources ] Errata ] Site Guide ]

Send mail to jpritchard@pobox.com with questions or comments about this web site.
Last modified: August 12, 2003