Professional Visual Basic 6 MTS Programming

( 1 )

Overview

Presently, books do not meet the needs of the experienced Visual Basic Developer interested in implementing MTS. Many existing books have devoted small sections to MTS. These are often great resources for many developers. However, they do not provide the necessary depth required for more advanced programmers to implement a large-scale application. Typically, this group of developers has gone beyond the knowledge level that existing books have to offer. They may often turn to alternate sources of information such ...

See more details below
Available through our Marketplace sellers.
Other sellers (Paperback)
  • All (10) from $1.99   
  • New (2) from $2.0   
  • Used (8) from $1.99   
Close
Sort by
Page 1 of 1
Showing All
Note: Marketplace items are not eligible for any BN.com coupons and promotions
$2.00
Seller since Sat Jan 01 01:01:01 EST 2005

Feedback rating:

(4377)

Condition:

New — never opened or used in original packaging.

Like New — packaging may have been opened. A "Like New" item is suitable to give as a gift.

Very Good — may have minor signs of wear on packaging but item works perfectly and has no damage.

Good — item is in good condition but packaging may have signs of shelf wear/aging or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Acceptable — item is in working order but may show signs of wear such as scratches or torn packaging. All specific defects should be noted in the Comments section associated with each item.

Used — An item that has been opened and may show signs of wear. All specific defects should be noted in the Comments section associated with each item.

Refurbished — A used item that has been renewed or updated and verified to be in proper working condition. Not necessarily completed by the original manufacturer.

New
New Book and Cover in Excellent Condition

Ships from: Cleveland, OH

Usually ships in 1-2 business days

  • Canadian
  • International
  • Standard, 48 States
  • Standard (AK, HI)
  • Express, 48 States
  • Express (AK, HI)
$39.99
Seller since Tue Jan 01 01:01:01 EST 2008

Feedback rating:

(171)

Condition: New
1861002440 BRAND NEW NEVER USED IN STOCK 125,000+ HAPPY CUSTOMERS SHIP EVERY DAY WITH FREE TRACKING NUMBER

Ships from: fallbrook, CA

Usually ships in 1-2 business days

  • Standard, 48 States
  • Standard (AK, HI)
Page 1 of 1
Showing All
Close
Sort by
Sending request ...

Overview

Presently, books do not meet the needs of the experienced Visual Basic Developer interested in implementing MTS. Many existing books have devoted small sections to MTS. These are often great resources for many developers. However, they do not provide the necessary depth required for more advanced programmers to implement a large-scale application. Typically, this group of developers has gone beyond the knowledge level that existing books have to offer. They may often turn to alternate sources of information such as the Visual Basic Programmers Journal, Microsoft Developers Network, and USENET groups. However, each of these provides the same types of repetitive code samples and snippets that address single and often obscure development topics. This book addresses the needs of these programmers, who need advice and instruction on how to use MTS to create a feature rich scalable application. These developers want to take advantage of the MTS programming model to develop a Visual Basic application that uses components to encapsulate business logic. This book is a sequel to the great introductory Wrox VB MTS book, Pro MTS/MSMQ.

Follows on from the first Wrox VB MTS book. Situates professional MTS programming in the real world. Written by an experienced MTS programmer in industry. Discusses MTS/COM from a deep design standpoint also. Transaction theory is covered. MTS security model discussed. Practical examples underlining theoretical discussion. ADO2 coverage. SQL7 coverage.

Visual Basic programmers with extensive application development experience. They will have read one or more of the advanced books on object oriented programming with Visual Basic 5 such as; Professional Visual Basic 5 Business Objects (Wrox Press), Doing Objects in Microsoft Visual Basic 5 (Microsoft Press), or Professional MTS MSMQ with VB and ASP (Wrox Press). These developers will have a firm understanding of relational databases having used ODBC to connect to SQL Server, Oracle or Sybase.

Read More Show Less

Product Details

  • ISBN-13: 9781861002440
  • Publisher: Wrox Press, Inc.
  • Publication date: 6/30/1999
  • Series: VB COM Series
  • Pages: 611
  • Product dimensions: 7.30 (w) x 9.16 (h) x 1.46 (d)

Read an Excerpt

Chapter 4: Transaction Processing

In the last chapter, we took a rather detailed look at COM and NITS and saw what was going on behind those spinning balls. This chapter will be less intensive but no less important.

Up until this point, our focus has been on the Object Request Broker (ORB) features of MTS. But now it's time to turn our attention to the center of MTS, transactions. Transaction processing systems are nothing new. They have been around for decades. However, before the release of NITS, transaction processing had never been combined with object management, a very powerful combination for developing distributed, component-based, software systems.

After completing this chapter, you should, be able to answer the following questions:

  • What is a transaction?
  • What does ACID have to do with transactions?
  • How can I change data in multiple databases and still meet the requirements of the ACID test?
  • How is MS DTC a part of MTS?
  • What is the difference between database transactions and MTS transactions?
  • What are Resource Dispensers and how do they work?
  • How does database connection pooling work?
  • What are the different stages in the life of an NITS transaction?

Introduction to Transactions

The first recorded use for the word transaction occurred in Roman civil law around 1460, which was used to define an adjustment for a dispute. Transaction was borrowed directly from the Latin word transactionem, meaning an agreement or accomplishment. It was not until another 200 years or so, the word transaction evolved to reflect a sense of business.

Actually transactions have existed since man has roamed the earth. To betterunderstand transactions, let's go back in time some 2 million years ago and visit the original founder of the fictional Grog Company. Grog's first business transaction was with a local clansman named Borg. Grog admired Borg's collection of seashells. At the same time, Borg admired Grog's collection of beads. Grog offered to trade Borg five seashells for five beads. Borg accepted, and the trade was made. This is a transaction. Actually, being new at this transaction business, a few alternatives were tried first.

Grog in good faith first gave Borg five seashells. However, Borg decided to see what would happen by with-holding the delivery of beads to Grog and not keeping his end of the bargain. Grog beat Borg on the head with a woolly mammoth tusk and then took his seashells back.

Although Borg had a hard head, he was a quick learner and apologized to Grog. This time, Borg gave Grog the five beads in return for five seashells and the transaction was completed.

I don't have to tell you, but you know that software systems are not completely bulletproof Functionality errors within the software, as well as errors that are beyond the control of the developer, such as hardware or network failures, will eventually occur. Distributed component-based systems are even more prone to failure because of their increased complexity. With remote components, executing on the behalf of clients, which are modifying data stored in different data sources, many pieces of complex software and hardware must work together seamlessly. When an error does occur, data cannot be left in an inconsistent state. An entire set of operations or changes performed on one or more data sources must all succeed (commit) or all fail (roll back).

To accomplish this all-or-nothing work management that ensures data consistency and integrity, we use transactions.

A transaction is an operation or a series of operations that change data from one consistent state to another.

In other words, a transaction simply treats multiple operations as one unit of work. To better understand this, consider the famous banking transaction scenario:

An individual walks up to an ATM machine and proceeds to transfer $500 from their savings account to their checking account. Two operations are actually being performed with this transfer. $500 is being withdrawn from the savings account and the same $500 is being deposited into the checking account. These two operations must be performed as one unit of work or as a transaction.

Either both of these operations must succeed or both must fail. If either individual operation fails, the transaction as a whole is not successful and any work that was already performed must be rolled back or undone in order to maintain the integrity of the accounts. Imagine if the withdrawal of $500 from the savings account succeeded but the deposit of $500 dollars into the checking account failed for whatever reason. Not only would the balances of the accounts not be correct, but the bank also would not have a very happy customer.

While most of the time a transaction is composed of multiple operations or units of work, the general term transaction is used for just about any operation that modifies data. For this reason you'll sometimes hear a single operation being referred to as a transaction. Don't be confused.

A transaction can be composed of one or more operations, although most of the time a transaction is composed of multiple operations.

ACID Properties

A transaction is an action, or series of actions, that transform a system from one consistent state to another. Every transaction must meet the following four essential requirements, known collectively as the ACID properties:
  • Atomicity
  • Consistency
  • Isolation
  • Durability

Atomicity

Atomicity refers to the all-or-nothing proposition of a transaction that we mentioned earlier. Once a transaction is started, it will either commit or abort.

If all of a transaction's operations complete successfully, the transaction can commit and the changes made by all of the transaction's operations will remain. If any of the operations fail, the transaction will abort and any of the changes already made by its operations will be undone. There is no chance that some operations in a transaction complete and some operations will fail. For example, when Borg withheld his beads from Grog, Grog took back his seashells. This transaction was completely aborted. However, when Grog and Borg traded as agreed, the transaction was executed completely.

To provide the ability to rollback or undo uncommitted changes, many data sources implement a logging mechanism. For example, SQL Server uses a write-ahead transaction log where changes are written to the log before they are applied or committed to the actual data pages. However, other data sources which are not relational database management systems (RDBMS), manage uncommitted transactions completely differently. As long as the data source is able to undo any uncommitted changes, if a transaction is rolled back, the technique used by a data source for managing transactions doesn't really matter.

Although the all-or-nothing behavior is the first thing that comes to mind in a discussion about transaction processing, it is important to remember that the atomicity property is only one of the four ACID properties. A transaction must also meet the other three ACID properties.

Consistency

A transaction also must be consistent.
This means that every process that makes up a transaction cannot break any business rules or semantics specified by the environment.

In simpler terms, business logic for Grog's transaction needs to be consistent with every transaction Grog executes. When Grog agreed to trade five beads for five seashells, Grog did in fact receive five seashells. At the same time, he gave Borg five beads. The business logic in Grog's time is very simple: "x something" for "y something". Yet it shows that even 2 million years ago, transactions maintained consistency.

Consistency ensures that changes made as a result of a transaction do not violate the integrity of the data. For example, in our ATM banking transaction scenario, after the transfer of $500 from an individual's savings account to their checking account both accounts have to reflect the transfer. Individual operations within a transaction may leave the data in an inconsistent state because a transaction is about transforming data from one consistent state to another, however once a transaction is committed, a transaction must guarantee the consistency and integrity of the data in all the data sources affected.

Again, in our ATM banking scenario, both accounts are in a consistent state before the transfer. During the transfer, money is first withdrawn from the savings account. At this point the data is in an inconsistent state. $500 dollars has been withdrawn as part of a transfer and has not been accounted for in another account. However, the transaction is not yet complete. The same $500 is then deposited into the checking account. This operation effectively completes the transaction and both accounts are returned to a consistent state.

Data sources such as SQL Server, and other RDBMS, enforce data consistency and integrity through the use of constraints.

Applications or business components can also enforce data consistency and integrity, although it is usually recommended to implement this functionality at the data source level. This is to ensure that data consistency is enforced even when changes to the data are made outside of your application's or component's control.
Remember, a transaction is not responsible for enforcing data integrity, but instead a transaction is only responsible for ensuring that data is returned to a consistent state after the transaction is either committed or aborted. The burden of understanding data integrity rules and possibly writing code to enforce them usually falls on the shoulders of the developer who is creating business components, so be prepared.

Transactions must also maintain data consistency and integrity when multiple concurrent users are accessing and modifying the same data, a concept that goes hand in hand with the next ACID property, isolation.

Isolation

All of the operations performed in a transaction must be isolated from operations performed by other transactions.

This property is sometimes referred to as serializability because in order to prevent one transaction's operations for interfering with another's, requests must be serialized or sequenced so that only one request for the same data is serviced at a time.

Let's consider isolation in our ATM banking transaction scenario. At the exact time an individual is transferring $500 from the savings account to the checking account, his significant other, standing at another ATM machine, decides to withdraw $100 from their checking account. If one transaction is performed before the other, and the transactions are serialized, there will not be a problem. However, if the withdrawal of $ 100 from the checking account occurs during the $500 transfer, the balance of the checking will appear inconsistent. To the individual transferring the $500 from the savings to the checking account, it would appear that the checking account was short $ 100, but to the other person withdrawing $ 100 from the checking account the balance would appear as though it had gained $400. If concurrent transactions could modify the same data at the same time, rollbacks would produce inconsistent results.

Isolation not only guarantees that multiple transactions cannot modify the same data at the same time, but isolation also guarantees that changes caused by one transaction's operations will not be seen by another transaction until the changes are either committed or aborted. Concurrent transactions will be unaware of each other's partial and inconsistent changes. This means that all requests to modify or read data that is already involved in a transaction are blocked until the transaction completes. Most data sources such as SQL Server and other RDBMS implement isolation through the use of locks. Individual data items or sets of data are locked from concurrent access if it is involved in a transaction. ...

Read More Show Less

Table of Contents

Introduction ..... 1
Chapter 1: MTS and the Distributed Environment ..... 7
Chapter 2: Introducing the MTS Explorer ..... 29
Chapter 3: COM and MTS Architecture ..... 53
Chapter 4: Transaction Processing ..... 97
Chapter 5: Designing MTS Components and Interfaces ..... 125
Chapter 6: Building MTS Components ..... 167
Chapter 7: Managing Components and Packages ..... 217
Chapter 8: Implementing Security ..... 261
Chapter 9: Debugging MTS Components ..... 307
Chapter 10: Administration ..... 347
Chapter 11: Data Services and MTS ..... 387
Chapter 12: MTS and the Internet ..... 427
Chapter 13: The Future of MTS = COM+ ..... 475
A Simple Sales Order Application Case Study ..... 507
Appendix A: Microsoft Transaction Server Type Library Reference ..... 581
Index ..... 585
Read More Show Less

Customer Reviews

Average Rating 4
( 1 )
Rating Distribution

5 Star

(0)

4 Star

(1)

3 Star

(0)

2 Star

(0)

1 Star

(0)
Sort by: Showing 1 Customer Reviews
  • Anonymous

    Posted Fri Jan 14 00:00:00 EST 2000

    An very good reference

    This book is an excellent reference. It deals with most aspects of MTS and it is very good from a practical point of view. The sample code and examples make you understand what you need to know to do develop a 3-tier VB MTS Application.

    Was this review helpful? Yes  No   Report this review
Sort by: Showing 1 Customer Reviews

If you find inappropriate content, please report it to Barnes & Noble
Why is this product inappropriate?
Comments (optional)