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 normalStateless
SDOResultSet are available on a detached SDOResultSet. The only exceptions include the following methods (described in other sections) that require an AppServer connection:
reOpenQuery()
— See the "Miscellaneous Management Methods" section.sendBatch()
— See the information onBatch
mode in the "Updating SDOResultSet Objects" section.sendBatchAndReOpen()
— See the information onBatch
mode in the "Updating SDOResultSet Objects" section.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:
Detaches from the AppObject that created the result set.
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.
Returns
true
if the SDOResultSet is attached to an AppObject. Otherwise, it returnsfalse
.Following is a typical scenario for using the detaching and attaching functionality:
- The SDOResultSet is created. Because the scrolling mode is
PREFETCH
, all the rows are read and returned to the client.- The SDOResultSet is detached from the AppObject.
- The AppObject is released (the AppServer connection closed).
- The client accesses data and possibly calls
startBatch()
and updates some data.- The SDOResultSet is attached to another open AppServer connection.
- The client calls
sendBatch()
to apply the modifications.NOTE: The SDOResultSet interface extends thejava.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 theattachToAppObj()
method.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |