home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 2005 June (DVD) / DPPRO0605DVD.iso / dotNETSDK / SETUP.EXE / netfxsd1.cab / readme_xml_81________.3643236F_FC70_11D3_A536_0090278A1BB8 < prev    next >
Encoding:
Extensible Markup Language  |  2002-06-20  |  6.1 KB  |  125 lines

  1. ∩╗┐<?xml version='1.0'?> 
  2. <?xml-stylesheet type="text/xsl" href="..\..\..\readme.xsl"?> 
  3. <sample windowsforms="true"> 
  4.  
  5. <title>COM+ Transactions</title>
  6. <title-short>COM+ Transactions</title-short>
  7.  
  8. <overview>
  9. <p class = "text">
  10. This sample demonstrates some aspects of COM+ Transactions in a .NET Framework application. The sample retrieves a value from the database, 
  11. then it allows the user to update the value. After the user specifies a new value and selects AutoCompletePost or Post the sample updates
  12. the database. Then the sample checks to see if the value entered is permitted (it must be a number =>0 and <=10). If the value is
  13. not permitted, the sample aborts the transaction and otherwise commits. Finally the sample shows what the new value in the database is.
  14. </p>
  15. </overview>
  16.  
  17.  
  18. <subdirectory>Technologies\ComponentServices\Transactions</subdirectory>
  19. <buildsteps> 
  20. <step> 
  21. Type <b>BuildAll.bat</b> from the command line.      
  22. <example> 
  23. C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions>buildall.bat
  24. </example>
  25. </step>
  26. <step>
  27. You'll also need to setup the database yourself when building from Visual Studio 7.
  28. <example>
  29. C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>osql -E -S (local)\NetSDK -i TxDB.sql
  30. </example>
  31. </step>
  32. <step>
  33. If you're building the sample from Visual Studio 7, you will need to install the TxDemoSvr.dll assembly to the Global Assembly Cache before running the sample.  Note: The gacutil.exe program is located in the <i>SDK\v1.1</i>\Bin directory.  
  34. <example>
  35. C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>gacutil -i TxDemoSvr.dll
  36. </example>
  37. </step>
  38. <step>
  39. The sample builds a C# and VB version of the client application and COM+ component. Source code for each language is stored in subdirectories named \CS and \VB. The C# component has 'CS' appended to its name as viewed in the Component Services administrative tool, 'TxDemoServerCS.TxObject'. The VB version is named 'TxDemoServerVB.TxObject'. When working with the sample code, be sure to observe and/or modify the version of the COM+ component that corresponds to the client application you launch.
  40. </step>
  41. <step>
  42. Review comments in the source code and build.bat files for more information on sample binary creation and registration steps.
  43. </step>
  44. </buildsteps>
  45. <runsteps> 
  46.  
  47. <step>
  48. NOTE: The COM+ .NET samples require Windows 2000 or higher in order to build and run.
  49. </step>
  50.  
  51. <step>
  52. Build the Transactions sample code following the instructions above.
  53. </step>
  54.  
  55. <step>
  56. Type <b>TxDemo.exe</b> from the command line.
  57. <example>
  58. C:\Program Files\Microsoft.NET\SDK\v1.1\Samples\Technologies\ComponentServices\Transactions\CS>txdemo.exe
  59. </example>
  60. </step>
  61. <step>
  62. The current value is read from the database and displayed.
  63. </step>
  64. <step>
  65. Enter a number =>0 and <=10 in the 'New value' field. Click on the button named 'Post'.
  66. </step>
  67. <step>
  68. The message 'About to commit the transaction' should appear. Click on 'OK'. The 'Current value' field is now updated with the value you entered.
  69. </step>
  70. <step>
  71. Enter a number =>0 or <=10 in the 'New value' field. Click on the button named 'Post'.
  72. </step>
  73. <step>
  74. The message 'About to abort the transaction because the new value (<yourvalue>) is either <0 or >10.' should appear. Press OK, the 'Current value' field doesn't change.
  75. This is because during the transaction the current value did change, but when the transaction was rolled back, the value was changed back to its original value. 
  76. </step>
  77. <step>
  78. Now try the same data with the 'AutoPost' button. You'll notice when the demo aborts the transaction it will throw an COMException. This is to notify the AutoComplete 
  79. to do an abort.
  80. </step>
  81. </runsteps>
  82.  
  83. <uninstallsteps>
  84. <step>
  85. To uninstall this sample, run <b>buildall.bat -u.</b> or <b>build.bat -u.</b> The batch file will then call regsvcs and gacutil with the /u switch in order to remove the sample files from the COM+ catalog and Global Assembly Cache.
  86. </step>
  87. </uninstallsteps>
  88.  
  89. <technologies> 
  90. <technology name = "ContextUtil" keyword ="ContextUtil">The ContextUtil class is used to tell the system either to abort or complete the transaction.
  91. </technology>
  92. <technology name = "COM+" keyword ="COM+">COM+ is the underlying system which automates the transactions in .NET.
  93. </technology>
  94. <technology name = "Transaction" keyword ="Transaction">An transaction is a set of operations that belong together, they should either 
  95. all be performed or all not be performed. Whenever one of the operations in the transaction fails, all prior operations should rollback to ensure 
  96. there is no inconsistency.
  97. </technology>
  98. <technology name = "SetAbort" keyword ="SetAbort">Method in ContextUtil that can be called to manually abort the transaction.
  99. </technology>
  100. <technology name = "SetComplete" keyword ="SetComplete">Method in ContextUtil that can be called to manually commit the transaction.
  101. </technology>
  102. <technology name = "AutoCompleteAttribute" keyword ="AutoCompleteAttribute">Attribute that enables automatic transactions on a method.
  103. </technology>
  104. <technology name = "TransactionAttribute" keyword ="TransactionAttribute">Attribute that enables transactions on a class.
  105. </technology>
  106. <technology name = "ServicedComponent" keyword ="ServicedComponent">Abstract class that implements the features to let a .NET class enrole in COM+.
  107. </technology>
  108.  
  109. </technologies>
  110.  
  111. <keywords> 
  112. <word name="COM+" keyword="COM+"/>
  113. <word name="Transaction" keyword="Transaction"/>
  114. <word name="Transactions" keyword="Transactions"/>
  115. <word name="SetAbort" keyword="SetAbort"/>
  116. <word name="SetComplete" keyword="SetComplete"/>
  117. <word name="ContextUtil" keyword="ContextUtil"/>
  118. <word name="AutoCompleteAttribute" keyword="AutoCompleteAttribute"/>
  119. <word name="TransactionAttribute" keyword="TransactionAttribute"/>
  120. <word name="TransactionOption" keyword="TransactionOption"/>
  121. <word name="TransactionOptions" keyword="TransactionOptions"/>
  122. <word name="ServicedComponent" keyword="ServicedComponent"/>
  123. </keywords>
  124. </sample>
  125.