WebSpeed
Developer’s Guide


Working with the Multi-page Transaction Example

WebSpeed provides an HTML-generating Web object that allows you to start and terminate multi-page database transactions. This is tran-tst.w in the WebSpeed examples directory. This Web object allows the user to view and update the CustNum and name fields of the Customer table. There are buttons to change the object between State-Aware and State-Less. There are also buttons to set the Transaction-State to Start, Undo, Retry, and Commit.

Here is a set of sample steps:

  1. Run tran-tst.w in your favorite broker.
  2. Press the State-Aware button.
  3. Press the Start button. This request sets up web-disp.p to start the transaction FOR THE NEXT REQUEST. Any updates made in this request are OUTSIDE THE TRANSACTION.
  4. Press the Refresh button. This shows that the transaction state has changed to "ACTIVE".
  5. Type 1 in the CustNum field and type New Name for Skiing in the Name field.
  6. Press the Update button.
  7. Type 2 in CustNum and New Name for Frisbee in Name.
  8. Press the Update button.
  9. Continue similarly Steps 7 and 8 as long as you want.
  10. Press the Undo button. This tells web-disp.p to undo the changes. However, the changes will not actually be undone until this request ends. The customer list at the bottom (which is created in the current request) still shows the changed names.
  11. Press the Refresh button. Now the name changes are undone.

Feel free to play with this code, accepting and undoing changes. Pay extra attention to when the transaction states become active.

Other things to try include:

  1. Press Start when the Web object is stateless.
  2. Press Start twice (that is, where the second press occurs when the transaction state is "ACTIVE").
  3. Press Undo, Retry, or Commit when there is no transaction active.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095