Progress
Open Client
Developer’s Guide


Detaching SDOResultSet Objects [Extension]

A Stateless SDOResultSet can be detached from an AppObject (or SDOAppObject) and re-attached to a specified (not necessarily the same) AppObject. By detaching the result set and releasing the AppObject (disconnecting the AppServer), the Open Client can use and manipulate the result set without holding any resources on the AppServer. Most of the SDOResultSet methods available on a normal Stateless SDOResultSet are available on a detached SDOResultSet. The only exceptions include the following methods (described in other sections) that require an AppServer connection:

Thus, before calling a method that requires an AppServer connection, you must attach the SDOResultSet to the same or a different AppObject that has a connection to the AppServer. The methods that provide this functionality include:

SYNTAX
void detachFromAppObj() [Extension] 

Detaches from the AppObject that created the result set.

SYNTAX
void attachToAppObj(SDOFactory ProxyObject) [Extension] 

Attaches to the AppObject, SubAppObject, or SDOAppObject specified by ProxyObject.

NOTE: ProxyGen-generated AppObjects and SubAppObjects, as well as the SDOAppObject proxy, all implement the SDOFactory interface.

SYNTAX
boolean isAttached() [Extension] 

Returns true if the SDOResultSet is attached to an AppObject. Otherwise, it returns false.

Following is a typical scenario for using the detaching and attaching functionality:

  1. The SDOResultSet is created. Because the scrolling mode is PREFETCH, all the rows are read and returned to the client.
  2. The SDOResultSet is detached from the AppObject.
  3. The AppObject is released (the AppServer connection closed).
  4. The client accesses data and possibly calls startBatch() and updates some data.
  5. The SDOResultSet is attached to another open AppServer connection.
  6. The client calls sendBatch() to apply the modifications.
NOTE: The SDOResultSet interface extends the java.io.Serializable interface. As a result, a detached SDOResultSet can be stored and retrieved from disk using the standard Java serialization mechanism. It can also be passed by value and returned from methods using remote method invocation (RMI). After being restored from disk or being received through an RMI call, the SDOResultSet can be re-attached to an AppObject using the attachToAppObj() method.


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