INFO: Remote Data Services (RDS) Objects Do Not Maintain State
ID: Q231416
|
The information in this article applies to:
-
Remote Data Service for ADO versions 1.0, 1.1, 1.5, 2.0, 2.01, 2.1, 2.1 SP1, 2.1 SP2
SUMMARY
When writing a custom business object designed to operate with Remote Data Services (RDS), it is important to remember that RDS objects cannot maintain state.
When RDS executes a method of an object from the client, the object is created on the server, executed (results returned to the client), and immediately destroyed.
This behavior is by design.
MORE INFORMATION
To understand why RDS creates the object to execute a single method, you must understand that the primary environment RDS was designed for was to function over the Internet. An Internet-based application has several needs to address:
- It must be able to service a large number of users.
- It must be able to operate in a disconnected state.
To service these requirements, an Internet Server needs to handle its resources as efficiently as possible. Consider the following example:
Joe is building an application for his salespeople. Joe would like to have his salespeople connect from anywhere and exchange information with the home office.
The Internet is the perfect medium for Joe because worldwide connectivity is cheap and plentiful. If Joe builds his application to maintain state on his server, what would happen if a salesperson logged in and didn't disconnect properly? What would happen if 100 or even 1,000 salespeople logged in, each maintaining 100k of stateful information? Server resources would be wasted and server performance would degrade.
With this information in mind, it was decided that the best route would be to design RDS to destroy the server object at the end of each method call. This does not mean you need to re-create the client-side object each time, it just means you need to remember that each time you use the client-side object, you are getting a new object on the server.
© Microsoft Corporation 1999, All Rights Reserved.
Contributions by Jonathan Johnson, Microsoft Corporation
REFERENCES
Microsoft Universal Data Access (MDAC)Webpage
For more information, please see the following article in the Microsoft Knowledge Base:
Q183315 HOWTO: Write and Validate a Custom Business Object with RDS
Additional query words:
ado mdac
Keywords : kbRDS kbGrpVBDB kbGrpMDAC
Version : WINDOWS:1.0,1.1,1.5,2.0,2.01,2.1,2.1 SP1,2.1 SP2
Platform : WINDOWS
Issue type : kbinfo