Detach SDOResultSet objects [extension]
- Last Updated: January 16, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
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 ResultSet and releasing the AppObject (disconnecting the application server), the Open Client can use and manipulate the ResultSet without holding any resources on the application server.
Most of the SDOResultSet methods available on a normal stateless SDOResultSet are available on a detached SDOResultSet. The exceptions are these methods, which require an application server connection:
-
reOpenQuery()— See Miscellaneous management methods. -
sendBatch()— See the information onBatchmode in Update SDOResultSet objects -
sendBatchAndReOpen()— See the information onBatchmode in Update SDOResultSet objects.
Thus, before calling a method that requires an application server connection, you must attach the SDOResultSet to the same or a different AppObject with a connection to the application server. Here are the methods that provide this functionality.
The following method detaches from the AppObject that created the ResultSet:
Syntax
|
The following method attaches to the AppObject, SubAppObject, or SDOAppObject specified by ProxyObject:
Syntax
|
The following method returns true if the SDOResultSet is attached to an
AppObject; otherwise, it returns false:
Syntax
|
The 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 application server connection closed).
- The client accesses data and possibly calls
startBatch()and updates some data. - The SDOResultSet is attached to another open application server connection.
- The client calls
sendBatch()to apply the modifications.
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 also can 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.