Setting Up the MTS Sample Bank Application
The Sample Bank application is a banking services application that credits, debits, and transfers money between accounts. Running the Sample Bank application allows you to test your installation of MTS with SQL Server 6.5 as well as practice package deployment and administration. Sample Bank has components written in Visual Basic, Visual C++, and Visual J++, and is located in the \MTS\Samples subdirectory. In addition, MTS provides an Active Server Page (ASP) that calls the Sample Bank components. This sample is called Bank.asp and is located in the \MTS\Samples\asp sub-directory.
The MTS ProgrammerÆs Guide provides an extensive tutorial describing how to build Sample Bank components.
To run the Sample Bank application, you must:
-
Select the Custom setup option and choose all MTS sub-components. See the Installing MTS Development Samples and Documentation topic for more information.
-
Set up the DSN.
-
Install the Sample Bank package.
-
Set up the MTS Explorer to monitor the Sample Bank package.
-
Run the Bank Client.
Setting Up the Sample Bank Application
MTS automatically configures the ODBC data source for Sample Bank during setup. Since the local machine is used by default, you must have SQL Server 6.5 installed on your local machine.
By default, the MTS DSN points to SQL Server 6.5. If you are using a database other than SQL Server 6.5, you must delete the DSN and add a new DSN called MTSSamples that points to your database.
If you want to use a SQL Server installation on another machine, use the ODBC service icon in the Control Panel to modify your data source as follows:
-
In the Data Sources dialog box, click the File DSN tab, and select the MTSSamples data source.
-
Click Configure and enter the name of the server you want to use.
Note that the Login ID and Password specified by the MTSSamples DSN are not used by Sample Bank. Sample Bank uses the "sa" account and null password. If your system administrator password is non-null or you want to specify a different login ID, you will have to modify the ODBC connection string in the Sample Bank source code.
To monitor the Sample Bank package components and transactions
-
Double-click the Sample Bank package icon in the right pane of the MTS Explorer.
-
Double-click the Components folder.
-
On the View menu, click Status View to display usage information for the various components in the package.
-
On the Window menu, click New Window.
-
Re-arrange the new window so the two windows do not overlap. You can stack different windows by selecting either the Cascade or Tile Horizontally options from the Window menu.
-
Click Transaction Statistics in the left pane of the new window.
-
On the Action menu, click Scope to clear the check mark and hide the left pane. Now transactions statistics are displayed when transactional components are used.
To run the Bank client
-
Make sure that Microsoft Distributed Transaction Coordinator (MS DTC) is running. Select My Computer in the left pane of the Transaction Server Explorer. Open the Action menu and click Start MS DTC if that option is enabled.
-
Make sure that SQL Server is running. You can start SQL Server from Control Panel.
-
On the Start menu, point to Programs, point to Microsoft Transaction Server, point to Samples, and click Bank Client. Arrange the Bank Client window so that it does not overlap the MTS Explorer windows.
-
The form will default to credit $1 to account number 1. Click Submit. You should see a response with the new balance.
-
Observe the MTS Explorer windows. You will notice that the component usage and transaction statistics windows have been updated.
-
Experiment with the bank client and observe the statistics using different transaction types, servers, and iterations. The first transaction takes longer than subsequent transaction for the following reasons:
-
The first transaction is creating the sample bank database tables and inserting temporary records.
-
Beginning the server process consumes system resources.
-
Opening database connections for the first time is a costly server operation.
![](images/vigs01.gif)