Kbase P11523: Update cancelled with Stateless AppServer
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  16/10/2008 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.1C
FACT(s) (Environment):
Progress 9.1D
SYMPTOM(s):
Update cancelled with Stateless AppServer
The database record does not exist or is locked by another user
Cannot update records when using SmartDataObjects with temp-tables in stateless Appserver
CAUSE:
When the stateless AppServer is diconnected the temp-table is destroyed in the server side, therefore there is not record or table to update.
FIX:
Two possible workaround could be use a state-aware appserver or set the 'Force to stateful mode' property for the SmartDataObject to TRUE. These workarounds will lock the AppServer agent.
A way to get the temp-table from a stateless AppServer is running the SmartDataObject in the client side and get the temp-table from a procedure running in the AppServer.
The following code is an example of how to get a temp-table from the Stateless AppServer:
DEFINE VARIABLE hProc AS HANDLE NO-UNDO.
DEFINE VARIABLE hServer AS HANDLE NO-UNDO.
/*Connects the session to the 'sports' partition and returns the
server handle.*/
RUN appServerConnect(INPUT 'sports':U, /*Partition name*/
INPUT ?, /*Security prompt*/
INPUT ?, /*AppServer info*/
OUTPUT hServer). /*Server handle*/
IF VALID-HANDLE(hServer)
THEN DO:
/*Runs the test.p procedure in the server handle*/
RUN test.p PERSISTENT SET hProc ON SERVER hServer.
/*Runs the internal procedure 'getTempTable in the test.p file
which is running in the AppServer and returns the temp-table*/
RUN getTempTable IN hProc (OUTPUT TABLE ttcust).
hServer:DISCONNECT().
END.