Class Session
The most important part of the Session object context is the Broker reference. The Broker is the client side object that represets the broker system. The Broker object is the Session's connections to the outside world, it allow the Session object to send and receive data from the 4GL server. A 4GL procedure is executed in (at most) five stages - two for sending input data and three to receive output data. A Send/Recive cycle is called A conversation: 1) Put the scalar input values onto the stream. 2) Put the input result sets onto the stream. 3) Receive the schema of the output temp-tables (or an Error stream). 4) Receive the scalar output values. (or an Error stream). 5) Prepare handles to the output result sets. If there is no relational (Temp-Table) data to be sent or received then an execution of a 4GL procedure would go thru the (1) and (4) steps only - that is the minimum. The session object can be CONNECTED or DISCONNECTED. A CONNECTED object Can be: IDLE or RUNNING or STREAMING. RUNNING: We are inside the PersistentProc() method. STREAMING: There is (are) an open output result set(s). The Seesion "knows" that it is STREAMING when by having outputSetsChain variable referencing the chain of output result sets. IDLE: It's not RUNNING or STREAMING. The Open4GLException exception is the ONLY way the Session object communicates errors the caller (the user of the Dynamic API). The Open4GLException class is further extended to describe different 4GL errors and conditions: STOP, ERROR and QUIT. But for a programmer that Does not want to get familiar with 4GL details it is generaly enough to handle Open4GLException exceptions ( sine StopException, for example, IS A, object oriented wise, Open4GLException. Normal (user) errors are not handled by a special Session state: Error data is handled like any other output data. When a FGLErrorException exception is caught, the Session object calls an ErrorMessageReader object to decode the error information. At any point where the Session object is willing to get interrupted, it sets the interrupt varable with an Interruptable object. For example, when the input result sets are being marshaled onto the stream, the interrupt variable is set to the InputTableStreamerNoSchema streamer object, so when Session.setStop() is called, setStop() calls interrupt.stop() and that triggers InputTableStreamerNoSchema.stop() that caueses the streaming process to stop. The Session object is referenced by the the output ResultSet objects. That is important because the user of the Dynamic API (which is, indirectly, the application), pulls data from the server after the Session.runProcedure() method already returned. So if there is an error in the process of streaming the output data, the ResultSet object can notify the Session by calling the non private version of Session.handleOutputErrors().
-
Constructor Summary
ConstructorsConstructorDescriptionSession
(String url, com.progress.common.ehnlog.IAppLogger log, IPoolProps sessionProperties) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
void
protected final void
finalize()
int
int
boolean
int
int
boolean
instantiateClass
(String className, int stateModel) boolean
boolean
Check server sessionboolean
void
runPersistentProcedure
(String procedureName, int stateModel) runPersistentProcedure
(String procedureName, ParameterSet params) runPersistentProcedure
(String procedureName, ParameterSet params, ResultSetSchema schema) runPersistentProcedure
(String requestID, String procedureName, ParameterSet params) runPersistentProcedure
(String requestID, String procedureName, ParameterSet params, ResultSetSchema schema) void
runProcedure
(String procedureName, ParameterSet params) void
runProcedure
(String procedureName, ParameterSet params, ResultSetSchema schema) void
runProcedure
(String requestID, String procedureName, ParameterSet params) void
runProcedure
(String requestID, String procedureName, ParameterSet params, ResultSetSchema schema) void
runStatelessProcedure
(String requestID, String fullProcedureName, ParameterSet params, Object procId, ResultSetSchema localSchema, int stateModel) boolean
boolean
int
setPoolState
(int newState) void
setStop()
void
shutdown()
void
stop()
toString()
long
-
Constructor Details
-
Session
-
-
Method Details
-
setStop
public void setStop() -
connect
public void connect(String requestID, String url, String userId, String password, String clientInfo) throws ConnectException, SystemErrorException - Throws:
ConnectException
SystemErrorException
-
addReference
public void addReference() -
deleteReference
- Throws:
SystemErrorException
Open4GLException
-
isConnected
public boolean isConnected() -
runPersistentProcedure
public PersistentProc runPersistentProcedure(String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException -
runPersistentProcedure
public PersistentProc runPersistentProcedure(String requestID, String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException -
runPersistentProcedure
public PersistentProc runPersistentProcedure(String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException -
runPersistentProcedure
public PersistentProc runPersistentProcedure(String procedureName, int stateModel) throws Open4GLException, RunTime4GLException, SystemErrorException -
instantiateClass
public PersistentProc instantiateClass(String className, int stateModel) throws Open4GLException, RunTime4GLException, SystemErrorException -
runPersistentProcedure
public PersistentProc runPersistentProcedure(String requestID, String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException -
runProcedure
public void runProcedure(String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException -
runProcedure
public void runProcedure(String requestID, String procedureName, ParameterSet params) throws Open4GLException, RunTime4GLException, SystemErrorException -
runProcedure
public void runProcedure(String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException -
runProcedure
public void runProcedure(String requestID, String procedureName, ParameterSet params, ResultSetSchema schema) throws Open4GLException, RunTime4GLException, SystemErrorException -
runStatelessProcedure
public void runStatelessProcedure(String requestID, String fullProcedureName, ParameterSet params, Object procId, ResultSetSchema localSchema, int stateModel) throws Open4GLException - Throws:
Open4GLException
-
isStreaming
public boolean isStreaming() -
getConnectionId
-
getRequestId
-
getSSLSubjectName
-
manageASKPingRequest
- Throws:
Open4GLException
-
getReturnValue
-
stop
public void stop() -
finalize
protected final void finalize() -
shutdown
public void shutdown() -
getSessionID
-
toString
-
getPoolState
public int getPoolState() -
setPoolState
public int setPoolState(int newState) -
getASKVersion
public int getASKVersion() -
getServerASKEnabled
public boolean getServerASKEnabled() -
getClientASKEnabled
public boolean getClientASKEnabled() -
getClientASKActivityTimeout
public int getClientASKActivityTimeout() -
getClientASKResponseTimeout
public int getClientASKResponseTimeout() -
tsCreated
public long tsCreated() -
serializeDatasetsAsXml
public boolean serializeDatasetsAsXml() -
serializeAsJson
public boolean serializeAsJson() -
isServerSessionValid
public boolean isServerSessionValid()Check server session- Returns:
- true if server session is valid, false otherwise
-