Disconnected by the server, code 48

jmac13

Member
Hi all,

I'm using 10.2b

I've got a program that does a query between 2 dates on a table. When I run the .w the first time its fine and the browse gets populated but if I run the query again (same session of the program) I get "Disconnected by the server, code 48" error and the program closes down cause its lost connection to the database. I think I've narrowed it down to a procedure within a persistent but I cant see why it causes that error:



Code:
for each loadlstd where                                        
    loadlstd.compno     =   bLoadlstd.compno  and                                       
    loadlstd.plantno    =   bLoadlstd.plantno and                                       
    loadlstd.lnStat     =   string(bLoadlstd.lh-number)    + ",":u +                                       
                            string(bLoadlstd.times-picked) + ",":u +                                       
                            string(bLoadlstd.lineno)                                       
    use-index findIwt                                       
    no-lock:  
  
    find loadlsth of loadlstd    
        no-lock no-error.   
  
    run createRecord.  
end.


CreateRecord:
Code:
define variable dteDelDate as date       no-undo.  
define variable intDelTime as integer no-undo.  
define buffer bNewLoadlstd for loadlstd.  


if  loadlstd.ltrdat <> ? then                  
    assign  dteDelDate  =   loadlstd.ltrdat  
            intDelTime  =   loadlstd.spare-dec2.                               
else  
    assign  dteDelDate  =   loadlsth.lh-deldate  
            intDelTime  =   loadlsth.ltrno.  
  
    
create ttIwts.   

    assign  ttIwts.rowLoadlstd      =   rowid(loadlstd)    
            ttIwts.intIwtNo         =   loadlstd.lh-number    
            ttIwts.ltrDat           =   dteDelDate   
            ttIwts.chrTimeConfirmed =   if ttIwts.ltrdat <> ? then string(intDelTime,"HH:MM:SS":u) else "":u  
            ttIwts.chrStatus        =   if loadlsth.lh-areaDsc = "C":u then "Delivered":u else "Intransit":u  
            ttIwts.dteSysConfDate   =   loadlsth.lh-deldate  
            ttIwts.chrSysConfTime   =   string(loadlsth.ltrno,"HH:MM:SS":u) when loadlsth.lh-deldate <> ?.  
  



if loadlstd.lnStat <> "":u  then    
do:   
    assign  ttIwts.intAvlNo     =   int(entry(1,loadlstd.lnstat))  
            ttIwts.intAvlDrop   =   int(entry(2,loadlstd.lnstat))  
            ttIwts.intAvlLn     =   int(entry(3,loadlstd.lnstat)).  
  
    find bNewLoadlstd where  
         bNewLoadlstd.compno       =   loadlstd.compno     and  
         bNewLoadlstd.plantno      =   loadlstd.plantno    and  
         bNewLoadlstd.lh-number    =   ttIwts.intAvlNo     and  
         bNewLoadlstd.times-picked =   ttIwts.intAvlDrop   and  
         bNewLoadlstd.lineno       =   ttIwts.intAvlLn  
         no-lock no-error.  
  
    if available bNewLoadlstd then  
        rowAvlLine  =   rowid(bNewLoadlstd).  
end.

The persistent is using a shared temp-table to pass back to calling program not sure if thats anything to do with it anyone got any ideas?

thanks
 
Also it seems to matter on the size of the date range.. im doing for nearly a year so not sure if thats another clue but why the second time is whats getting me
 
DB log

Code:
WARNING: -l exceeded. Automatically increasing from 1850 to 1860. 

Previous message sent on behalf of user 23, server pid 9664, broker pid 4428. (5512) 

 SYSTEM ERROR: This server has too many open cursors so the cursor creation attempt by user 23 at line 783 in Z:/vobs_rkt/src/glue/nsadb.c, msgcode 50, ROWID 0, table 189, index 571.
 
just found that system error:

SYSTEM ERROR: This server has too many open cursors so the cursor creation attempt by user <NUM> at line <NUM> in <NUM>, msgcode <NUM>, ROWID <NUM>, table <num>, index <NUM>. (15093)

The server has too many open cursors. This is usually caused because the ABL program is not closing its handle to a called persistent procedure that performs a database operation.
 
worked it out rzr

some persistent was getting creating like 6000 instants and never getting Destoryed ...:P

once i stop that and Destoryed it all was good
 
Back
Top